1
2 #include
3
4 template < typename Derived >
5 class Base
6 {
7 public:
8 Base() {}
9 ~Base() {}
10 int set()
11 {
12 return ( static_cast
13 }
14 };
15
16 template< typename data_t >
17 class DerivedClass : public Base< DerivedClass
18 {
19 public:
20 DerivedClass() {}
21 ~DerivedClass() {}
22 setImpl()
23 {
24 std::cout << "seImpl() called" << std::endl;
25 }
26 };
27
28 int main ()
29 {
30 Base< DerivedClass
31 b->set();
32 return 0;
33 }
30行目の*bはDerivedClass
0 件のコメント:
コメントを投稿