How can you detect contiguous iterators, given that there is no std::contiguous_iterator_tag?

Original answer The rationale is given in N4284, which is the adopted version of the contiguous iterators proposal: This paper introduces the term “contiguous iterator” as a refinement of random-access iterator, without introducing a corresponding contiguous_iterator_tag, which was found to break code during the Issaquah discussions of Nevin Liber’s paper N3884 “Contiguous Iterators: A Refinement … Read more

What are the typical use cases of an iterator_trait

Pointers into an array can be used as random access iterators. There needs to be some consistent way to get these types both for pointers (which obviously can’t have the types declared as nested types, since only classes can have nested types) and for class-type iterators. The traits class template provides this consistent way. The … Read more