Take a look at this peice of code:
template
Pointer::Iterator> BinaryTree::GetBegi
It will compile if you change it to this:
template
struct BinaryTree : Collection {
Pointer::Iterator> GetBeginning() const;
};
template
Pointer::Iterator> BinaryTree::GetBeginning() const
{
return Pointer::Iterator>();
}
In general, the original code isn't quite right because it implies that GetBeginning() can return any collection, while (I'm assuming) it can only return binary tree collections.
EDIT:
After some digging, it seems that VC++ doesn't handle well injected class names. That is, the original code will compile if you remove from Collection::Iterator in the method declaration:
template
struct BinaryTree : Collection {
Pointer GetBeginning() const;
};
template
Pointer::Iterator> BinaryTree::GetBeginning() const
{
return Pointer::Iterator>();
}