C#, C♯, C#相談室 Part75
■ このスレッドは過去ログ倉庫に格納されています
0406402
2012/09/23(日) 09:35:24.51直した、
前置の例: Counter& Counter::operator++() { this->str += "1"; return *this; }
後置の例: std::auto_ptr<Counter> Counter::operaotr++(int) { std::auto_ptr<Counter> p(*this); this->str += "1"; return p; }
ただし、Counterクラスはstd::stringクラスのメンバstrを持ち、かつコピーコンストラクタCounter::Counter(Counter&)が定義されているとする
■ このスレッドは過去ログ倉庫に格納されています