N
none
I have the following in a header file:
template<typename T>
class Sub : public MyBase<T>
{
public:
// Types
typedef MyBase<T> Superclass;
typedef typename Superclass::ImageType ImageType;
// Modifiers
ImageType & GetImageData();
};
In the .cpp file I then do:
template<typename T>
ImageType &
Sub<T>::GetImageData()
{
// return null;
}
But I get the error:
error: expected constructor, destructor, or type conversion before '&' token
Why this error? ImageType has been typedef'ed.
template<typename T>
class Sub : public MyBase<T>
{
public:
// Types
typedef MyBase<T> Superclass;
typedef typename Superclass::ImageType ImageType;
// Modifiers
ImageType & GetImageData();
};
In the .cpp file I then do:
template<typename T>
ImageType &
Sub<T>::GetImageData()
{
// return null;
}
But I get the error:
error: expected constructor, destructor, or type conversion before '&' token
Why this error? ImageType has been typedef'ed.