S
Suneeel
Hi all,
I'm new at templates.
I've written this code and am compiling it with gcc 4.1.0 on RedHat
Linux 9.
/////////temptest.h//////////////
template <class T>
class tempclass
{
public:
tempclass();
void fun();
}
////////tempclass.cpp////////////////
#include "temptest.cpp"
template <class T>
temptest<T>::temptest()
{
}
template <class T>
void temptest<T>::fun()
{
}
I get the following errors
temptest.h:5: error: ISO C++ forbids declaration of 'tempclass'
with no type
temptest.cpp:4: error: expected constructor, destructor, or type
conversion before '<' token
temptest.cpp:10: error: expected initializer before '<' token
could someone please explain to me what the problem is...
I'm new at templates.
I've written this code and am compiling it with gcc 4.1.0 on RedHat
Linux 9.
/////////temptest.h//////////////
template <class T>
class tempclass
{
public:
tempclass();
void fun();
}
////////tempclass.cpp////////////////
#include "temptest.cpp"
template <class T>
temptest<T>::temptest()
{
}
template <class T>
void temptest<T>::fun()
{
}
I get the following errors
temptest.h:5: error: ISO C++ forbids declaration of 'tempclass'
with no type
temptest.cpp:4: error: expected constructor, destructor, or type
conversion before '<' token
temptest.cpp:10: error: expected initializer before '<' token
could someone please explain to me what the problem is...