Hi people,
I am a beginner for using templates in C++. I think the system is nice
but why using it when it is not necessary. Anyway, in my code I need to
remove the "template aspect" of a file for compatibility with other
parts of the code. That means, I had a file like that :
(in a file MyClass.inl)
template <class T>
MyClass<T>::MyMethod(...,...,...)
{
....
}
(in a file MyClass.hpp)
template <class T>
class MyClass
{
public:
MyClass2 MyObject2;
}
(not templated class in a file MyClass2.hpp)
class MyClass2
{
....
}
I wanted to change that by removing the templates in MyClass, so now I got:
(in a file MyClass.cpp)
MyClass::MyMethod(...,...,...)
{
....
}
(still the same, in a file MyClass.hpp)
class MyClass
{
public:
MyClass2 MyObject2;
}
(still the same, not templated class in a file MyClass2.hpp)
class MyClass2
{
....
}
My problem is that the second class (MyClass2) is not recognized anymore
by the new file MyClass.hpp and I got the following message:
error C2079: 'MyObject2' uses undefined class 'MyClass2'
Someone has an idea, please ?