wrote:
> Thanks a lot Bux.
> You said there is no guarantee that list<T>::iterator is inheritable.
> Is it defined in spec ?
By "spec" you mean the C++ standard? No, it's not defined in the standard.
That's why there is no guarantee. The type list<T>::iterator is marked
as "implementation defined".
For std::vector<T>, for instance, an implementation is free to use T* as an
iterator. In that case, std::vector<T>::iterator would not be a class.
For std::list<T>, an implementation is free to use trickery (using virtual
base classes) to prevent inheritance. (Although, to my knowledge, no
implementation actually does that.)
> How come you implement a iterator without the class since you have lots
> of operator to overload ?
Huh? I do not understand, and I think that sentence just does not parse. I
am not a native speaker of English, so my parser has little tolerance and
is very limited with regard to error correction.
Best
Kai-Uwe Bux