T
Tomás
template <class T>
class Monkey {
int Eat();
};
int Monkey::Eat()
{
return 5;
}
This won't compile. In what way have I defined the function wrongly? Are
you supposed to write them like this?:
template <class T>
class Monkey {
int Eat();
};
template <class T>
int Monkey<T>::Eat()
{
return 5;
}
It seems a bit pedantic to me that you have to that...
-Tomás
class Monkey {
int Eat();
};
int Monkey::Eat()
{
return 5;
}
This won't compile. In what way have I defined the function wrongly? Are
you supposed to write them like this?:
template <class T>
class Monkey {
int Eat();
};
template <class T>
int Monkey<T>::Eat()
{
return 5;
}
It seems a bit pedantic to me that you have to that...
-Tomás