I understand that the standard allows std::vector<int, A>
to have the same type of iterators for different allocators A
. This is called SCARY iterators.
Now the question is does the standard allow std::vector<int, A>::iterator
be simply a typedef of A::pointer
, thus making it just an int*
for the default allocator?
Or is there some (implicit) requirement for it to be a separate class type per container? If there is no such requirement then why all major implementations (including the SCARY ones) don't use this approach? It would presumably reduce compiler work even further, though now code that overloads on int*
and vector<>::iterator
will not compile.