关于模板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 阅读(1043) 评论(4) 编辑 收藏 引用 所属分类: C++
Powered by: C++博客 Copyright © l1989