
Tom Widmer <tom_usenet@hotmail.com> writes:
If I'm misusing the code, is there some reason for this? It's inconvenient that the default constructor doesn't initialize pointers to some consistent value; the problem goes away when I change the indirect_iterator default constructor:
94c94,96 < indirect_iterator() {} ---
indirect_iterator() : super_t( Iterator() ) {}
That gives you a false sense of safety. Default initializing many iterator types is a no-op - they are still unusable (e.g. std::list::iterator).
or, in the same way, int*. Tom's right. You don't have a right to expect very much from a default-constructed iterator. You can't even copy it without inducing undefined behavior. -- Dave Abrahams Boost Consulting www.boost-consulting.com