2008-03-20から1日間の記事一覧

template と operator = を組み合わせてみたところ死亡(スペランカー先生のように)

C++

ソース #include <windows.h> #include <stdio.h> class A { public: A(int i = 0) : m(i) { puts("コンストラクタかしら"); } ~A() { puts("デストラクタかしら"); } A& operator = (const A& a) { this->m = a.m; puts("operator = かしら"); return *this; } int m; }; int ma</stdio.h></windows.h>…