Add contiguous iterator utilities. How about is_contiguous_iterator
and as_contiguous_range
:
1
2
3
4
5
6
7
8
9
10
11
12
template<typename I, typename S,
CONCEPT_REQUIRES_(RandomAccessIterator<I>() &&
SizedSentinel<S, I>() &&
is_contiguous_iterator<I>())>
iterator_range<std::add_pointer_t<reference_t<I>>>
as_contiguous_range(I begin, S end)
{
if(begin == end)
return {nullptr, nullptr};
else
return {addressof(*begin), addressof(*begin) + (end - begin)};
}
inplace_merge
work with forward iterators