so I wrote a class and one of the functions returns a struct, both function and struct are contained within the class's private section. It's something similar to this:
template <typename T>
class myClass {
private:
struct myStruct {
...
T item;
...
};
myStruct* func(myStruct*, myStruct*);
public:
....
};
template <typename T>
inline myClass<T>::myStruct* func(myStruct* a, myStruct* b) {
...
};
When I try to test run the code, however, it warns me:
C2061 syntax error: identifier 'myStruct'
C2143 syntax error: missing ';' before '{'
C2447 '{': missing function header (old-style formal list?)
I've tried moving the function into the public area but it didn't help. I also tried to add "myClass::" before every "myStruct" in the parameters but the warnings still remain. Does it have something to do with the struct being inside of the class? Can someone help me, please?