Is there any practical use for ContiguousIterator?

Viewed 125
1 Answers

Named requirements in C++17 are first and foremost notation. They only correlate to detectable things in the language if they impose requirements which are detectable. And ContiguousIterator does not impose detectable requirements on types which implement them.

So the most practical thing ContiguousIterator allows you to do is write "you must pass a ContiguousIterator" in your documentation, with the understanding that the reader will track down the specific details of that term. But no, ContiguousIterator as defined in C++17 does not permit you to write anything which could statically detect the difference between ContiguousIterators and RandomAccessIterators that are not contiguous.

Related