template<typename T> class Outer
{
private:
enum Type { one, two, three };
class Inner
{
public:
void setType( Type type );
Type getType() const;
private:
Type _type;
}
}
template<typename T>
void Outer<T>::Inner::setType( Type type )
{
_type = type;
}
template<typename T>
Outer<T>::Type Outer<T>::Inner::getType() const
{
return _type;
}
This causes the compiler to bark at the definition of the getType function ( line 22 ). It works just fine for the setType, or any other function with a void return type, but trying to return anything else, even a primitive, results in a compilation error.
What's wrong with it?