With this code (just a class of test):
typedef unsigned short UInt16;
template<class T>
class CClass
{
public:
SValue* getNewSValue(void);
private:
typedef struct {
T *mValue;
T *next;
T *previous;
UInt16 index;
} SValue;
};
template<typename T>
SValue* CClass<T>::getNewSValue(void)
{
return new SValue;
}
I have the following errors:
error C2143: syntax error : missing ';' before '*'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Is it possible to use a Struct within a class? If I declare the struct out of the class the template doesn't see the template T
.