Strange error message
-
I all I have the following scheme on two classes:
template <typename T> class MyClass {
public:
class MySubClass {
public: ~MySubClass( void );
};
};
And I tryed:
template <typename T> MyClass<T>::MySubClass::~MySubClass( void )
{
}And also:
template <typename T> class MyClass {
public:
template <typename T> class MySubClass { public: ~MySubClass( void ); };
};
With:
template <typename T> MyClass<T>::MySubClass<T>::~MySubClass( void )
{
}But I get the message "error C2039: '__dtor' : is not a member of 'tBaseArray<T>'" for the 1st case and that same message plus "error C2935: '<Unknown>' : template-class-id redefined as a global function" for the 2nd case. I tryed googling for __dtor, and it seems to be a function to enable using delete on a class, but I don't understand why I get this error neither how to bypass it. Can anybody help?? =) best regards hint_54
-
I all I have the following scheme on two classes:
template <typename T> class MyClass {
public:
class MySubClass {
public: ~MySubClass( void );
};
};
And I tryed:
template <typename T> MyClass<T>::MySubClass::~MySubClass( void )
{
}And also:
template <typename T> class MyClass {
public:
template <typename T> class MySubClass { public: ~MySubClass( void ); };
};
With:
template <typename T> MyClass<T>::MySubClass<T>::~MySubClass( void )
{
}But I get the message "error C2039: '__dtor' : is not a member of 'tBaseArray<T>'" for the 1st case and that same message plus "error C2935: '<Unknown>' : template-class-id redefined as a global function" for the 2nd case. I tryed googling for __dtor, and it seems to be a function to enable using delete on a class, but I don't understand why I get this error neither how to bypass it. Can anybody help?? =) best regards hint_54
Its working fine with my VC++ 7 compiler
template class MyClass {
public:
class MySubClass { public: ~MySubClass( void ); };
};
template MyClass::MySubClass::~MySubClass( void )
{
}i created the instance as follows
MyClass t;
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar." My Blog | Understanding State Pattern in C++ -
Its working fine with my VC++ 7 compiler
template class MyClass {
public:
class MySubClass { public: ~MySubClass( void ); };
};
template MyClass::MySubClass::~MySubClass( void )
{
}i created the instance as follows
MyClass t;
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar." My Blog | Understanding State Pattern in C++ -
VC6's template support was not complete, especially when dealing with complex classes like your example. Sometimes, you just have to say it ain't gonna work in 6. BTW, "dtor" is the abbreviation for "destructor" (along with "ctor" for "constructor")
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ VB > soccer