Cpp_houjie
Cpp_houjie copied to clipboard
代码没编译通过
$ g++ C++OOP2-ex.cpp
C++OOP2-ex.cpp:66:16: error: declaration of template parameter ‘T’ shadows template parameter
66 | template <typename T>
| ^~~~~~~~
C++OOP2-ex.cpp:65:12: note: template parameter ‘T’ declared here
65 | template <typename T,
| ^~~~~~~~
C++OOP2-ex.cpp:102:16: error: declaration of template parameter ‘T’ shadows template parameter
102 | template <typename T>
| ^~~~~~~~
C++OOP2-ex.cpp:101:12: note: template parameter ‘T’ declared here
101 | template <typename T,
| ^~~~~~~~
C++OOP2-ex.cpp: In function ‘void jj03::test_template_template_parameters_2()’:
C++OOP2-ex.cpp:118:16: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
118 | XCls<double, auto_ptr> p4;
| ^~~~~~~~
In file included from /usr/include/c++/9/memory:80,
from C++OOP2-ex.cpp:6:
/usr/include/c++/9/bits/unique_ptr.h:53:28: note: declared here
53 | template<typename> class auto_ptr;
| ^~~~~~~~
请仔细检查