File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 692
692
The result of the application of library functions
693
693
to invalid ranges is undefined.
694
694
695
+ \pnum
696
+ For an iterator \tcode {i} of a type that
697
+ models \libconcept {contiguous_iterator}\iref {iterator.concept.contiguous },
698
+ library functions are permitted
699
+ to replace \range {i}{s} with
700
+ \range {to_address(i)}{to_address(i + ranges::distance(i, s))}, and
701
+ to replace \countedrange {i}{n} with \range {to_address(i)}{to_address(i + n)}.
702
+ \begin {note }
703
+ This means a program cannot rely on any side effects of
704
+ dereferencing a contiguous iterator \tcode {i},
705
+ because library functions might operate on
706
+ pointers obtained by \tcode {to_address(i)}
707
+ instead of operating on \tcode {i}.
708
+ Similarly, a program cannot rely on any side effects of
709
+ individual increments on a contiguous iterator \tcode {i},
710
+ because library functions might advance \tcode {i} only once.
711
+ \end {note }
712
+
695
713
\pnum
696
714
All the categories of iterators require only those functions that are realizable for a given category in
697
715
constant time (amortized).
You can’t perform that action at this time.
0 commit comments