2010-08-03から1日間の記事一覧

C++のテンプレートは非変か

C++のテンプレートって非変なんですかね?ここでの議論がちょっと気になった。 上の記事のコメ欄で template <class T> class Hoge { public: Hoge() { } template<class U> Hoge(const Hoge<U>&) { } template<class U> Hoge& operator=(const Hoge<U>&) { return *this; } };こう書いてしま</u></class></u></class></class>…