- 论坛徽章:
- 0
|
1 #include <iostream>
2 #include <list>
3
4 template <class protocol>
5 class connection {
6 public:
7 connection() { };
8 };
9
10 template <typename protocol>
11 class connection_manager {
12 typedef std::list< connection<protocol> > clist;
13 typedef std::list< connection<protocol> >::iterator clistitr;
14
15 public:
16 connection_manager() { };
17 };
18
19 int main(void)
20 {
21 connection_manager<int> cm;
22
23 return 0;
24 }
|
$ g++ test02.cpp
==========================================================
ERROR:
==========================================================
28 test02.cpp:13: error: type ‘std::list<connection<protocol>, std::allocat or<connection<protocol> > >’
is not derived from type ‘connection_manager<protocol>’
29 test02.cpp:13: error: expected ‘;’ before ‘clistitr’ |
用VC6.0这个程序没有问题. |
|