Take a look at this peice of code:
template
Pointer::Iterator> BinaryTree::GetBegi
For those interested, I tried writing a minimal sample reproducing the problem:
template
struct Pointer {};
template
struct Collection {
struct Iterator {};
};
template
struct BinaryTree : Collection{
Pointer::Iterator> GetBeginning() const;
struct BinaryTreeIterator : Collection::Iterator {
template
BinaryTreeIterator(BinaryTreeIterator*, X) {}
struct Position {
static int atBeginning() { return 0; }
};
};
};
template
Pointer::Iterator> BinaryTree::GetBeginning() const
{
return Pointer::Iterator>();
}
int main(){
BinaryTree bt;
bt.GetBeginning();
}
And yes, I get the error too. I can't see any obvious errors in what we've seen of your code, but then again, just this example has used more nested classes and inheritance than most sane C++ programmers do in a year, so I can't say for sure that your code is or isn't correct.
Moreover, I've had to guess quite a bit to piece this together. (What's atBeginning supposed to be? What are the actual class interfaces?)
But I suspect it'd work better (and be more readable and easier to debug) if you didn't inherit everything from everything else.
Update I tried compiling the above with GCC and Comeau's online compiler, and both accepted it. So it seems like it could be a compiler bug.