I have code like this:
template<typename T> class Foo
{
struct Some_struct
{
T object;
Some_struct* next;
};
public:
Some_struct* function(); //declaration of my function
};
template<typename T> Some_struct* Foo<T>::function() //this definition is wrong
{
//something inside
return pointer_to_Some_struct;
}
How proper definition should look like ?
You forgot to add the proper scope to the return type.
Doing that:
template<typename T> typename Foo<T>::Some_struct* Foo<T>::function()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With