Quantcast
Channel: New iterator requirements - Stack Overflow
Viewing all articles
Browse latest Browse all 2

New iterator requirements

$
0
0

I noticed that most if not all containers now require their ::iterator type to satisfy LegacySomethingIterator instead of SomethingIterator.

For example, std::vector<>::iteratornow requires:

iteratorLegacyRandomAccessIterator

This seems to be the same for most of the other containers, all requiring their iterators to go from SomethingIterator to LegacySomethingIterator.

There are also the "new" requirements that took the names of the old requirements, such as RandomAccessIterator, why were these added? It seems to me that the new variants just shadow the legacy variants, no differences.

Why were new ones created in the first place, their requirements look the same to me. Why don't the new ones just replace the old requirements instead of right now having 2 different names for them (e.g. RandomAccessIterator and LegacyRandomAccessIterator)?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images