I think that separating a template class interface from implementation
probably creates more problems than it is worth. A better solution might
be to work on your notation.
Try taking a look at the doxygen website (http://www.stack.nl/~dimitri/
doxygen/index.html) Doxygen is a documentation system for C++ and other
languages. I find that by using doxygen syntax to document my code it
naturally becomes clean and manageable, even in big temaplate classes. On
top of that you get a pdf of html manual documenting your code. It is a
bit of a virtuous circle.
As for the iterator, you will probably find it much easier to write it as
a separate non-nested class and then just typedef it into the class:
class iterator_for_foo {
// stuff
};
class foo {
public:
typedef iterator_for_foo iterator;
// stuff
};
For writing iterators the boost iterator library is very useful (http://
www.boost.org/doc/libs/1_35_0/libs/iterator/doc/index.html)
I personally wouldn't worry about people being able to "declare Iterator
by itself." What are they going to do with it?
Brian.