c++ - How to define the constructor of an inner template class of another template class? -
i have inner template class of template class:
// hpp file template< class t1 > class c1 { // ... public: // ... c1(); template< class t2 > c2 { // ... c2(); }; };
when declare inner class constructor errors:
//cpp file template<> c1< mytype >::c1() { // ... } template<> template< class t2 > c1< mytype >::c2::c2() // error: invalid use of template-name ‘class c1<mytype>::c2’ without argument list { // ... }
i have tried :
template<> template< class t2 > c1< mytype >::c2<t2>::c2() // error: invalid use of incomplete type ‘class c1<mytype>::c2<t2>’ { // ... }
incomplete type, constructor has no type...
i little stuck here. how declare it?
perform following:
template<typename t1> template<typename t2> c1<t1>::c2<t2>::c2() { }
Comments
Post a Comment