關于模板Default拷貝構造函數與模板Copy拷貝構造函數(- - 我也不知道該不該這么稱呼。。)
編譯錯誤:--------------------Configuration: x - Win32 Release--------------------Compiling...x.cppD:\書籍資料\C++Test\c++作業\asdf\x.cpp(16) : error C2535: '__thiscall Test<_Uy>::Test<_Uy>(const class Test<_Uy> &)' : member function already defined or declared D:\書籍資料\C++Test\c++作業\asdf\x.cpp(10) : see declaration of 'Test<_Ty>::Test<_Ty>' D:\書籍資料\C++Test\c++作業\asdf\x.cpp(20) : see reference to class template instantiation 'Test<_Ty>' being compiledD:\書籍資料\C++Test\c++作業\asdf\x.cpp(25) : error C2668: 'Test<int>::Test<int>' : ambiguous call to overloaded functionError executing cl.exe.Creating browse info file...
x.exe - 2 error(s), 0 warning(s)看下面的代碼:只是將兩個函數位置調換一下就正確了- -;
posted on 2009-10-12 18:49 l1989 閱讀(1057) 評論(4) 編輯 收藏 引用 所屬分類: C++
Powered by: C++博客 Copyright © l1989