關(guān)于模板Default拷貝構(gòu)造函數(shù)與模板Copy拷貝構(gòu)造函數(shù)(- - 我也不知道該不該這么稱呼。。)
編譯錯(cuò)誤:--------------------Configuration: x - Win32 Release--------------------Compiling...x.cppD:\書(shū)籍資料\C++Test\c++作業(yè)\asdf\x.cpp(16) : error C2535: '__thiscall Test<_Uy>::Test<_Uy>(const class Test<_Uy> &)' : member function already defined or declared D:\書(shū)籍資料\C++Test\c++作業(yè)\asdf\x.cpp(10) : see declaration of 'Test<_Ty>::Test<_Ty>' D:\書(shū)籍資料\C++Test\c++作業(yè)\asdf\x.cpp(20) : see reference to class template instantiation 'Test<_Ty>' being compiledD:\書(shū)籍資料\C++Test\c++作業(yè)\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)看下面的代碼:只是將兩個(gè)函數(shù)位置調(diào)換一下就正確了- -;
posted on 2009-10-12 18:49 l1989 閱讀(1071) 評(píng)論(4) 編輯 收藏 引用 所屬分類: C++
Powered by: C++博客 Copyright © l1989