2008-09-12から1日間の記事一覧

オペレータ=とコピーコンストラクタの間違った使い方

C++

下のコードは永遠に、 Copy constructor called を出力し続ける、なぜか?どう直せばよいか? class { public: int data; trouble() { data = 0; } trouble(const trouble &old); trouble operator = (const trouble old); } trouble::trouble(const trouble…