I would like to use a template class instance as a private member of a Managed Class. Is it possible?
I´ve tried this on my managed class:
I have an unmanaged code that implements the templateCode:// PDAManager.h #include "lista.h" public __gc class PDAManager { private: Lista <int> ListaDeInteiros;
I got this compiler error: Error C3633.Code://lista.h #pragma unmanaged template <class Classe2> class Lista { protected: Celula<Classe2> sCabeca, sFinal, *pPonteiro; int iTamanho; public: Celula<Classe2> *pPont, *pPont1, *pPont2, *pPont3; Lista (); //.Lista (Lista<Classe> &l); //.~Lista (); //... } template <class Classe2> Lista<Classe2>::Lista() { sCabeca.suc = &sFinal; sCabeca.ant = &sCabeca; sFinal.suc = &sFinal; sFinal.ant = &sCabeca; pPonteiro = &sFinal; iTamanho = 0; }
What this Error C3633 means???Compiling...
PDAManager.cpp
c:\MyWorks\PDAManager.Net\PDAManager.h(72) : error C3633: cannot define 'ListaDeInteiros' as a member of managed 'IEAv::PDAManager'
because of the presence of default constructor 'Lista<Classe2>::Lista' on class 'Lista<Classe2>'
with
[
Classe2=int
]
and
[
Classe2=int
]
and
[
Classe2=int
]
c:\MyWorks\PDAManager.Net\PDAIncludes\LISTA.H(56) : see declaration of 'Lista<Classe2>::Lista'
with
[
Classe2=int
]
and
[
Classe2=int
]
What is Interesting that if I take out the constructor and destructor of the template class, the error disapear...
I have attached the managed class and the templates classes that I am using. PDAManager.h has the Managed class that uses a template unmanaged class. Lista.h has the class that is an unmanaged template class.




Reply With Quote