Hi all! I have a situaion in which I want to declare a class member function returning a type that depends on the class itself. Let me give you an example:
class Substring {
private:
string the_substring_;
public:
// (...)
static SubstringTree getAllSubstring(string main_string, int min_size);
};
And SubstringTree is defined as follows:
typedef set<Substring, Substring::Comparator> SubstringTree;
My problem is that if I put the SubstringTree definition after the Substring definition, the static method says it doesn't know SubstringTree. If I reverse the declarations, then the typedef says it doesn't know Substring.
How can I do it? Thanks in advance.