diff --git a/source/algorithms.tex b/source/algorithms.tex index 8ddca61117..2a14136950 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -242,9 +242,9 @@ \tcode{ranges::next(i, s)}. \pnum -Overloads of algorithms that take \libconcept{Range} arguments\iref{range.range} +Overloads of algorithms that take \libconcept{range} arguments\iref{range.range} behave as if they are implemented by calling \tcode{ranges::begin} and -\tcode{ranges::end} on the \libconcept{Range}(s) and +\tcode{ranges::end} on the \libconcept{range}(s) and dispatching to the overload in namespace \tcode{ranges} that takes separate iterator and sentinel arguments. @@ -619,11 +619,11 @@ ForwardIterator first, ForwardIterator last, Predicate pred); namespace ranges { - template S, class Proj = identity, - IndirectUnaryPredicate> Pred> + template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr bool all_of(I first, S last, Pred pred, Proj proj = {}); - template, Proj>> Pred> + template, Proj>> Pred> constexpr bool all_of(R&& r, Pred pred, Proj proj = {}); } @@ -635,11 +635,11 @@ ForwardIterator first, ForwardIterator last, Predicate pred); namespace ranges { - template S, class Proj = identity, - IndirectUnaryPredicate> Pred> + template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr bool any_of(I first, S last, Pred pred, Proj proj = {}); - template, Proj>> Pred> + template, Proj>> Pred> constexpr bool any_of(R&& r, Pred pred, Proj proj = {}); } @@ -651,11 +651,11 @@ ForwardIterator first, ForwardIterator last, Predicate pred); namespace ranges { - template S, class Proj = identity, - IndirectUnaryPredicate> Pred> + template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr bool none_of(I first, S last, Pred pred, Proj proj = {}); - template, Proj>> Pred> + template, Proj>> Pred> constexpr bool none_of(R&& r, Pred pred, Proj proj = {}); } @@ -673,24 +673,24 @@ [[no_unique_address]] F fun; template - requires ConvertibleTo && ConvertibleTo + requires convertible_to && convertible_to operator for_each_result() const & { return {in, fun}; } template - requires ConvertibleTo && ConvertibleTo + requires convertible_to && convertible_to operator for_each_result() && { return {std::move(in), std::move(fun)}; } }; - template S, class Proj = identity, - IndirectUnaryInvocable> Fun> + template S, class Proj = identity, + indirectly_unary_invocable> Fun> constexpr for_each_result for_each(I first, S last, Fun f, Proj proj = {}); - template, Proj>> Fun> + template, Proj>> Fun> constexpr for_each_result, Fun> for_each(R&& r, Fun f, Proj proj = {}); } @@ -725,25 +725,25 @@ Predicate pred); namespace ranges { - template S, class T, class Proj = identity> - requires IndirectRelation, const T*> + template S, class T, class Proj = identity> + requires indirect_relation, const T*> constexpr I find(I first, S last, const T& value, Proj proj = {}); - template - requires IndirectRelation, Proj>, const T*> + template + requires indirect_relation, Proj>, const T*> constexpr safe_iterator_t find(R&& r, const T& value, Proj proj = {}); - template S, class Proj = identity, - IndirectUnaryPredicate> Pred> + template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr I find_if(I first, S last, Pred pred, Proj proj = {}); - template, Proj>> Pred> + template, Proj>> Pred> constexpr safe_iterator_t find_if(R&& r, Pred pred, Proj proj = {}); - template S, class Proj = identity, - IndirectUnaryPredicate> Pred> + template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr I find_if_not(I first, S last, Pred pred, Proj proj = {}); - template, Proj>> Pred> + template, Proj>> Pred> constexpr safe_iterator_t find_if_not(R&& r, Pred pred, Proj proj = {}); } @@ -772,15 +772,15 @@ BinaryPredicate pred); namespace ranges { - template S1, ForwardIterator I2, Sentinel S2, + template S1, forward_iterator I2, sentinel_for S2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable + requires indirectly_comparable constexpr subrange find_end(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template - requires IndirectlyComparable, iterator_t, Pred, Proj1, Proj2> + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> constexpr safe_subrange_t find_end(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -810,16 +810,16 @@ BinaryPredicate pred); namespace ranges { - template S1, ForwardIterator I2, Sentinel S2, + template S1, forward_iterator I2, sentinel_for S2, class Proj1 = identity, class Proj2 = identity, - IndirectRelation, - projected> Pred = ranges::equal_to> + indirect_relation, + projected> Pred = ranges::equal_to> constexpr I1 find_first_of(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template, Proj1>, - projected, Proj2>> Pred = ranges::equal_to> + template, Proj1>, + projected, Proj2>> Pred = ranges::equal_to> constexpr safe_iterator_t find_first_of(R1&& r1, R2&& r2, Pred pred = {}, @@ -845,12 +845,12 @@ BinaryPredicate pred); namespace ranges { - template S, class Proj = identity, - IndirectRelation> Pred = ranges::equal_to> + template S, class Proj = identity, + indirect_relation> Pred = ranges::equal_to> constexpr I adjacent_find(I first, S last, Pred pred = {}, Proj proj = {}); - template, Proj>> Pred = ranges::equal_to> + template, Proj>> Pred = ranges::equal_to> constexpr safe_iterator_t adjacent_find(R&& r, Pred pred = {}, Proj proj = {}); } @@ -872,20 +872,20 @@ ForwardIterator first, ForwardIterator last, Predicate pred); namespace ranges { - template S, class T, class Proj = identity> - requires IndirectRelation, const T*> + template S, class T, class Proj = identity> + requires indirect_relation, const T*> constexpr iter_difference_t count(I first, S last, const T& value, Proj proj = {}); - template - requires IndirectRelation, Proj>, const T*> + template + requires indirect_relation, Proj>, const T*> constexpr range_difference_t count(R&& r, const T& value, Proj proj = {}); - template S, class Proj = identity, - IndirectUnaryPredicate> Pred> + template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr iter_difference_t count_if(I first, S last, Pred pred, Proj proj = {}); - template, Proj>> Pred> + template, Proj>> Pred> constexpr range_difference_t count_if(R&& r, Pred pred, Proj proj = {}); } @@ -939,29 +939,29 @@ [[no_unique_address]] I2 in2; template - requires ConvertibleTo && ConvertibleTo + requires convertible_to && convertible_to operator mismatch_result() const & { return {in1, in2}; } template - requires ConvertibleTo && ConvertibleTo + requires convertible_to && convertible_to operator mismatch_result() && { return {std::move(in1), std::move(in2)}; } }; - template S1, InputIterator I2, Sentinel S2, + template S1, input_iterator I2, sentinel_for S2, class Proj1 = identity, class Proj2 = identity, - IndirectRelation, - projected> Pred = ranges::equal_to> + indirect_relation, + projected> Pred = ranges::equal_to> constexpr mismatch_result mismatch(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template, Proj1>, - projected, Proj2>> Pred = ranges::equal_to> + indirect_relation, Proj1>, + projected, Proj2>> Pred = ranges::equal_to> constexpr mismatch_result, safe_iterator_t> mismatch(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -1002,15 +1002,15 @@ BinaryPredicate pred); namespace ranges { - template S1, InputIterator I2, Sentinel S2, + template S1, input_iterator I2, sentinel_for S2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable + requires indirectly_comparable constexpr bool equal(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template - requires IndirectlyComparable, iterator_t, Pred, Proj1, Proj2> + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> constexpr bool equal(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); } @@ -1031,16 +1031,16 @@ BinaryPredicate pred); namespace ranges { - template S1, ForwardIterator I2, - Sentinel S2, class Pred = ranges::equal_to, class Proj1 = identity, + template S1, forward_iterator I2, + sentinel_for S2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable + requires indirectly_comparable constexpr bool is_permutation(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template - requires IndirectlyComparable, iterator_t, Pred, Proj1, Proj2> + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> constexpr bool is_permutation(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); } @@ -1069,16 +1069,16 @@ BinaryPredicate pred); namespace ranges { - template S1, ForwardIterator I2, - Sentinel S2, class Pred = ranges::equal_to, + template S1, forward_iterator I2, + sentinel_for S2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable + requires indirectly_comparable constexpr subrange search(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template - requires IndirectlyComparable, iterator_t, Pred, Proj1, Proj2> + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> constexpr safe_subrange_t search(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -1107,15 +1107,15 @@ BinaryPredicate pred); namespace ranges { - template S, class T, + template S, class T, class Pred = ranges::equal_to, class Proj = identity> - requires IndirectlyComparable + requires indirectly_comparable constexpr subrange search_n(I first, S last, iter_difference_t count, const T& value, Pred pred = {}, Proj proj = {}); - template - requires IndirectlyComparable, const T*, Pred, Proj> + requires indirectly_comparable, const T*, Pred, Proj> constexpr safe_subrange_t search_n(R&& r, range_difference_t count, const T& value, Pred pred = {}, Proj proj = {}); @@ -1142,24 +1142,24 @@ [[no_unique_address]] O out; template - requires ConvertibleTo && ConvertibleTo + requires convertible_to && convertible_to operator copy_result() const & { return {in, out}; } template - requires ConvertibleTo && ConvertibleTo + requires convertible_to && convertible_to operator copy_result() && { return {std::move(in), std::move(out)}; } }; - template S, WeaklyIncrementable O> - requires IndirectlyCopyable + template S, weakly_incrementable O> + requires indirectly_copyable constexpr copy_result copy(I first, S last, O result); - template - requires IndirectlyCopyable, O> + template + requires indirectly_copyable, O> constexpr copy_result, O> copy(R&& r, O result); } @@ -1177,8 +1177,8 @@ template using copy_n_result = copy_result; - template - requires IndirectlyCopyable + template + requires indirectly_copyable constexpr copy_n_result copy_n(I first, iter_difference_t n, O result); } @@ -1196,14 +1196,14 @@ template using copy_if_result = copy_result; - template S, WeaklyIncrementable O, class Proj = identity, - IndirectUnaryPredicate> Pred> - requires IndirectlyCopyable + template S, weakly_incrementable O, class Proj = identity, + indirect_unary_predicate> Pred> + requires indirectly_copyable constexpr copy_if_result copy_if(I first, S last, O result, Pred pred, Proj proj = {}); - template, Proj>> Pred> - requires IndirectlyCopyable, O> + template, Proj>> Pred> + requires indirectly_copyable, O> constexpr copy_if_result, O> copy_if(R&& r, O result, Pred pred, Proj proj = {}); } @@ -1217,12 +1217,12 @@ template using copy_backward_result = copy_result; - template S1, BidirectionalIterator I2> - requires IndirectlyCopyable + template S1, bidirectional_iterator I2> + requires indirectly_copyable constexpr copy_backward_result copy_backward(I1 first, S1 last, I2 result); - template - requires IndirectlyCopyable, I> + template + requires indirectly_copyable, I> constexpr copy_backward_result, I> copy_backward(R&& r, I result); } @@ -1241,12 +1241,12 @@ template using move_result = copy_result; - template S, WeaklyIncrementable O> - requires IndirectlyMovable + template S, weakly_incrementable O> + requires indirectly_movable constexpr move_result move(I first, S last, O result); - template - requires IndirectlyMovable, O> + template + requires indirectly_movable, O> constexpr move_result, O> move(R&& r, O result); } @@ -1260,12 +1260,12 @@ template using move_backward_result = copy_result; - template S1, BidirectionalIterator I2> - requires IndirectlyMovable + template S1, bidirectional_iterator I2> + requires indirectly_movable constexpr move_backward_result move_backward(I1 first, S1 last, I2 result); - template - requires IndirectlyMovable, I> + template + requires indirectly_movable, I> constexpr move_backward_result, I> move_backward(R&& r, I result); } @@ -1283,12 +1283,12 @@ template using swap_ranges_result = mismatch_result; - template S1, InputIterator I2, Sentinel S2> - requires IndirectlySwappable + template S1, input_iterator I2, sentinel_for S2> + requires indirectly_swappable constexpr swap_ranges_result swap_ranges(I1 first1, S1 last1, I2 first2, S2 last2); - template - requires IndirectlySwappable, iterator_t> + template + requires indirectly_swappable, iterator_t> constexpr swap_ranges_result, safe_iterator_t> swap_ranges(R1&& r1, R2&& r2); } @@ -1325,14 +1325,14 @@ template using unary_transform_result = copy_result; - template S, WeaklyIncrementable O, - CopyConstructible F, class Proj = identity> - requires Writable>> + template S, weakly_incrementable O, + copy_constructible F, class Proj = identity> + requires writable>> constexpr unary_transform_result transform(I first1, S last1, O result, F op, Proj proj = {}); - template - requires Writable, Proj>>> + requires writable, Proj>>> constexpr unary_transform_result, O> transform(R&& r, O result, F op, Proj proj = {}); @@ -1343,31 +1343,31 @@ [[no_unique_address]] O out; template - requires ConvertibleTo && - ConvertibleTo && ConvertibleTo + requires convertible_to && + convertible_to && convertible_to operator binary_transform_result() const & { return {in1, in2, out}; } template - requires ConvertibleTo && - ConvertibleTo && ConvertibleTo + requires convertible_to && + convertible_to && convertible_to operator binary_transform_result() && { return {std::move(in1), std::move(in2), std::move(out)}; } }; - template S1, InputIterator I2, Sentinel S2, - WeaklyIncrementable O, CopyConstructible F, class Proj1 = identity, + template S1, input_iterator I2, sentinel_for S2, + weakly_incrementable O, copy_constructible F, class Proj1 = identity, class Proj2 = identity> - requires Writable, + requires writable, projected>> constexpr binary_transform_result transform(I1 first1, S1 last1, I2 first2, S2 last2, O result, F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); - template - requires Writable, Proj1>, + template + requires writable, Proj1>, projected, Proj2>>> constexpr binary_transform_result, safe_iterator_t, O> transform(R1&& r1, R2&& r2, O result, @@ -1391,23 +1391,23 @@ Predicate pred, const T& new_value); namespace ranges { - template S, class T1, class T2, class Proj = identity> - requires Writable && - IndirectRelation, const T1*> + template S, class T1, class T2, class Proj = identity> + requires writable && + indirect_relation, const T1*> constexpr I replace(I first, S last, const T1& old_value, const T2& new_value, Proj proj = {}); - template - requires Writable, const T2&> && - IndirectRelation, Proj>, const T1*> + template + requires writable, const T2&> && + indirect_relation, Proj>, const T1*> constexpr safe_iterator_t replace(R&& r, const T1& old_value, const T2& new_value, Proj proj = {}); - template S, class T, class Proj = identity, - IndirectUnaryPredicate> Pred> - requires Writable + template S, class T, class Proj = identity, + indirect_unary_predicate> Pred> + requires writable constexpr I replace_if(I first, S last, Pred pred, const T& new_value, Proj proj = {}); - template, Proj>> Pred> - requires Writable, const T&> + template, Proj>> Pred> + requires writable, const T&> constexpr safe_iterator_t replace_if(R&& r, Pred pred, const T& new_value, Proj proj = {}); } @@ -1436,17 +1436,17 @@ template using replace_copy_result = copy_result; - template S, class T1, class T2, OutputIterator O, - class Proj = identity> - requires IndirectlyCopyable && - IndirectRelation, const T1*> + template S, class T1, class T2, + output_iterator O, class Proj = identity> + requires indirectly_copyable && + indirect_relation, const T1*> constexpr replace_copy_result replace_copy(I first, S last, O result, const T1& old_value, const T2& new_value, Proj proj = {}); - template O, + template O, class Proj = identity> - requires IndirectlyCopyable, O> && - IndirectRelation, Proj>, const T1*> + requires indirectly_copyable, O> && + indirect_relation, Proj>, const T1*> constexpr replace_copy_result, O> replace_copy(R&& r, O result, const T1& old_value, const T2& new_value, Proj proj = {}); @@ -1454,15 +1454,15 @@ template using replace_copy_if_result = copy_result; - template S, class T, OutputIterator O, - class Proj = identity, IndirectUnaryPredicate> Pred> - requires IndirectlyCopyable + template S, class T, output_iterator O, + class Proj = identity, indirect_unary_predicate> Pred> + requires indirectly_copyable constexpr replace_copy_if_result replace_copy_if(I first, S last, O result, Pred pred, const T& new_value, Proj proj = {}); - template O, class Proj = identity, - IndirectUnaryPredicate, Proj>> Pred> - requires IndirectlyCopyable, O> + template O, class Proj = identity, + indirect_unary_predicate, Proj>> Pred> + requires indirectly_copyable, O> constexpr replace_copy_if_result, O> replace_copy_if(R&& r, O result, Pred pred, const T& new_value, Proj proj = {}); @@ -1482,11 +1482,11 @@ ForwardIterator first, Size n, const T& value); namespace ranges { - template O, Sentinel S> + template O, sentinel_for S> constexpr O fill(O first, S last, const T& value); - template R> + template R> constexpr safe_iterator_t fill(R&& r, const T& value); - template O> + template O> constexpr O fill_n(O first, iter_difference_t n, const T& value); } @@ -1505,14 +1505,14 @@ ForwardIterator first, Size n, Generator gen); namespace ranges { - template S, CopyConstructible F> - requires Invocable && Writable> + template S, copy_constructible F> + requires invocable && writable> constexpr O generate(O first, S last, F gen); - template - requires Invocable && OutputRange> + template + requires invocable && output_range> constexpr safe_iterator_t generate(R&& r, F gen); - template - requires Invocable && Writable> + template + requires invocable && writable> constexpr O generate_n(O first, iter_difference_t n, F gen); } @@ -1533,20 +1533,20 @@ Predicate pred); namespace ranges { - template S, class T, class Proj = identity> - requires IndirectRelation, const T*> + template S, class T, class Proj = identity> + requires indirect_relation, const T*> constexpr subrange remove(I first, S last, const T& value, Proj proj = {}); - template - requires Permutable> && - IndirectRelation, Proj>, const T*> + template + requires permutable> && + indirect_relation, Proj>, const T*> constexpr safe_subrange_t remove(R&& r, const T& value, Proj proj = {}); - template S, class Proj = identity, - IndirectUnaryPredicate> Pred> + template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr subrange remove_if(I first, S last, Pred pred, Proj proj = {}); - template, Proj>> Pred> - requires Permutable> + template, Proj>> Pred> + requires permutable> constexpr safe_subrange_t remove_if(R&& r, Pred pred, Proj proj = {}); } @@ -1576,29 +1576,29 @@ template using remove_copy_result = copy_result; - template S, WeaklyIncrementable O, class T, + template S, weakly_incrementable O, class T, class Proj = identity> - requires IndirectlyCopyable && - IndirectRelation, const T*> + requires indirectly_copyable && + indirect_relation, const T*> constexpr remove_copy_result remove_copy(I first, S last, O result, const T& value, Proj proj = {}); - template - requires IndirectlyCopyable, O> && - IndirectRelation, Proj>, const T*> + template + requires indirectly_copyable, O> && + indirect_relation, Proj>, const T*> constexpr remove_copy_result, O> remove_copy(R&& r, O result, const T& value, Proj proj = {}); template using remove_copy_if_result = copy_result; - template S, WeaklyIncrementable O, - class Proj = identity, IndirectUnaryPredicate> Pred> - requires IndirectlyCopyable + template S, weakly_incrementable O, + class Proj = identity, indirect_unary_predicate> Pred> + requires indirectly_copyable constexpr remove_copy_if_result remove_copy_if(I first, S last, O result, Pred pred, Proj proj = {}); - template, Proj>> Pred> - requires IndirectlyCopyable, O> + template, Proj>> Pred> + requires indirectly_copyable, O> constexpr remove_copy_if_result, O> remove_copy_if(R&& r, O result, Pred pred, Proj proj = {}); } @@ -1618,12 +1618,12 @@ BinaryPredicate pred); namespace ranges { - template S, class Proj = identity, - IndirectRelation> C = ranges::equal_to> + template S, class Proj = identity, + indirect_relation> C = ranges::equal_to> constexpr subrange unique(I first, S last, C comp = {}, Proj proj = {}); - template, Proj>> C = ranges::equal_to> - requires Permutable> + template, Proj>> C = ranges::equal_to> + requires permutable> constexpr safe_subrange_t unique(R&& r, C comp = {}, Proj proj = {}); } @@ -1652,20 +1652,20 @@ template using unique_copy_result = copy_result; - template S, WeaklyIncrementable O, - class Proj = identity, IndirectRelation> C = ranges::equal_to> - requires IndirectlyCopyable && - (ForwardIterator || - (InputIterator && Same, iter_value_t>) || - IndirectlyCopyableStorable) + template S, weakly_incrementable O, + class Proj = identity, indirect_relation> C = ranges::equal_to> + requires indirectly_copyable && + (forward_iterator || + (input_iterator && same_as, iter_value_t>) || + indirectly_copyable_storable) constexpr unique_copy_result unique_copy(I first, S last, O result, C comp = {}, Proj proj = {}); - template, Proj>> C = ranges::equal_to> - requires IndirectlyCopyable, O> && - (ForwardIterator> || - (InputIterator && Same, iter_value_t>) || - IndirectlyCopyableStorable, O>) + template, Proj>> C = ranges::equal_to> + requires indirectly_copyable, O> && + (forward_iterator> || + (input_iterator && same_as, iter_value_t>) || + indirectly_copyable_storable, O>) constexpr unique_copy_result, O> unique_copy(R&& r, O result, C comp = {}, Proj proj = {}); } @@ -1678,11 +1678,11 @@ BidirectionalIterator first, BidirectionalIterator last); namespace ranges { - template S> - requires Permutable + template S> + requires permutable constexpr I reverse(I first, S last); - template - requires Permutable> + template + requires permutable> constexpr safe_iterator_t reverse(R&& r); } @@ -1700,12 +1700,12 @@ template using reverse_copy_result = copy_result; - template S, WeaklyIncrementable O> - requires IndirectlyCopyable + template S, weakly_incrementable O> + requires indirectly_copyable constexpr reverse_copy_result reverse_copy(I first, S last, O result); - template - requires IndirectlyCopyable, O> + template + requires indirectly_copyable, O> constexpr reverse_copy_result, O> reverse_copy(R&& r, O result); } @@ -1722,10 +1722,10 @@ ForwardIterator last); namespace ranges { - template S> + template S> constexpr subrange rotate(I first, I middle, S last); - template - requires Permutable> + template + requires permutable> constexpr safe_subrange_t rotate(R&& r, iterator_t middle); } @@ -1743,12 +1743,12 @@ template using rotate_copy_result = copy_result; - template S, WeaklyIncrementable O> - requires IndirectlyCopyable + template S, weakly_incrementable O> + requires indirectly_copyable constexpr rotate_copy_result rotate_copy(I first, I middle, S last, O result); - template - requires IndirectlyCopyable, O> + template + requires indirectly_copyable, O> constexpr rotate_copy_result, O> rotate_copy(R&& r, iterator_t middle, O result); } @@ -1767,13 +1767,13 @@ UniformRandomBitGenerator&& g); namespace ranges { - template S, class Gen> - requires Permutable && - UniformRandomBitGenerator> + template S, class Gen> + requires permutable && + uniform_random_bit_generator> I shuffle(I first, S last, Gen&& g); - template - requires Permutable> && - UniformRandomBitGenerator> + template + requires permutable> && + uniform_random_bit_generator> safe_iterator_t shuffle(R&& r, Gen&& g); } @@ -1813,13 +1813,13 @@ Compare comp); namespace ranges { - template S, class Comp = ranges::less, + template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I sort(I first, S last, Comp comp = {}, Proj proj = {}); - template - requires Sortable, Comp, Proj> + template + requires sortable, Comp, Proj> constexpr safe_iterator_t sort(R&& r, Comp comp = {}, Proj proj = {}); } @@ -1838,12 +1838,12 @@ Compare comp); namespace ranges { - template S, class Comp = ranges::less, + template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable I stable_sort(I first, S last, Comp comp = {}, Proj proj = {}); - template - requires Sortable, Comp, Proj> + template + requires sortable, Comp, Proj> safe_iterator_t stable_sort(R&& r, Comp comp = {}, Proj proj = {}); } @@ -1868,13 +1868,13 @@ RandomAccessIterator last, Compare comp); namespace ranges { - template S, class Comp = ranges::less, + template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I partial_sort(I first, I middle, S last, Comp comp = {}, Proj proj = {}); - template - requires Sortable, Comp, Proj> + template + requires sortable, Comp, Proj> constexpr safe_iterator_t partial_sort(R&& r, iterator_t middle, Comp comp = {}, Proj proj = {}); @@ -1909,19 +1909,20 @@ namespace ranges { template using partial_sort_copy_result = copy_result; - template S1, RandomAccessIterator I2, Sentinel S2, + template S1, + random_access_iterator I2, sentinel_for S2, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyCopyable && Sortable && - IndirectStrictWeakOrder, projected> + requires indirectly_copyable && sortable && + indirect_strict_weak_order, projected> constexpr partial_sort_copy_result partial_sort_copy(I1 first, S1 last, I2 result_first, S2 result_last, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template - requires IndirectlyCopyable, iterator_t> && - Sortable, Comp, Proj2> && - IndirectStrictWeakOrder, Proj1>, - projected, Proj2>> + requires indirectly_copyable, iterator_t> && + sortable, Comp, Proj2> && + indirect_strict_weak_order, Proj1>, + projected, Proj2>> constexpr partial_sort_copy_result, safe_iterator_t> partial_sort_copy(R1&& r, R2&& result_r, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -1941,11 +1942,11 @@ Compare comp); namespace ranges { - template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> + template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr bool is_sorted(I first, S last, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = ranges::less> + template, Proj>> Comp = ranges::less> constexpr bool is_sorted(R&& r, Comp comp = {}, Proj proj = {}); } @@ -1967,11 +1968,11 @@ Compare comp); namespace ranges { - template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> + template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr I is_sorted_until(I first, S last, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = ranges::less> + template, Proj>> Comp = ranges::less> constexpr safe_iterator_t is_sorted_until(R&& r, Comp comp = {}, Proj proj = {}); } @@ -1993,13 +1994,13 @@ RandomAccessIterator last, Compare comp); namespace ranges { - template S, class Comp = ranges::less, + template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I nth_element(I first, I nth, S last, Comp comp = {}, Proj proj = {}); - template - requires Sortable, Comp, Proj> + template + requires sortable, Comp, Proj> constexpr safe_iterator_t nth_element(R&& r, iterator_t nth, Comp comp = {}, Proj proj = {}); } @@ -2015,12 +2016,12 @@ const T& value, Compare comp); namespace ranges { - template S, class T, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> + template S, class T, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr I lower_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = + template, Proj>> Comp = ranges::less> constexpr safe_iterator_t lower_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); @@ -2036,11 +2037,11 @@ const T& value, Compare comp); namespace ranges { - template S, class T, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> + template S, class T, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr I upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = + template, Proj>> Comp = ranges::less> constexpr safe_iterator_t upper_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); @@ -2056,12 +2057,12 @@ const T& value, Compare comp); namespace ranges { - template S, class T, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> + template S, class T, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr subrange equal_range(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = + template, Proj>> Comp = ranges::less> constexpr safe_subrange_t equal_range(R&& r, const T& value, Comp comp = {}, Proj proj = {}); @@ -2077,12 +2078,12 @@ const T& value, Compare comp); namespace ranges { - template S, class T, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> + template S, class T, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr bool binary_search(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = + template, Proj>> Comp = ranges::less> constexpr bool binary_search(R&& r, const T& value, Comp comp = {}, Proj proj = {}); @@ -2096,11 +2097,11 @@ ForwardIterator first, ForwardIterator last, Predicate pred); namespace ranges { - template S, class Proj = identity, - IndirectUnaryPredicate> Pred> + template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr bool is_partitioned(I first, S last, Pred pred, Proj proj = {}); - template, Proj>> Pred> + template, Proj>> Pred> constexpr bool is_partitioned(R&& r, Pred pred, Proj proj = {}); } @@ -2115,13 +2116,13 @@ Predicate pred); namespace ranges { - template S, class Proj = identity, - IndirectUnaryPredicate> Pred> + template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr subrange partition(I first, S last, Pred pred, Proj proj = {}); - template, Proj>> Pred> - requires Permutable> + template, Proj>> Pred> + requires permutable> constexpr safe_subrange_t partition(R&& r, Pred pred, Proj proj = {}); } @@ -2137,13 +2138,13 @@ Predicate pred); namespace ranges { - template S, class Proj = identity, - IndirectUnaryPredicate> Pred> - requires Permutable + template S, class Proj = identity, + indirect_unary_predicate> Pred> + requires permutable subrange stable_partition(I first, S last, Pred pred, Proj proj = {}); - template, Proj>> Pred> - requires Permutable> + template, Proj>> Pred> + requires permutable> safe_subrange_t stable_partition(R&& r, Pred pred, Proj proj = {}); } @@ -2169,31 +2170,32 @@ [[no_unique_address]] O2 out2; template - requires ConvertibleTo && - ConvertibleTo && ConvertibleTo + requires convertible_to && + convertible_to && convertible_to operator partition_copy_result() const & { return {in, out1, out2}; } template - requires ConvertibleTo && - ConvertibleTo && ConvertibleTo + requires convertible_to && + convertible_to && convertible_to operator partition_copy_result() && { return {std::move(in), std::move(out1), std::move(out2)}; } }; - template S, WeaklyIncrementable O1, WeaklyIncrementable O2, - class Proj = identity, IndirectUnaryPredicate> Pred> - requires IndirectlyCopyable && IndirectlyCopyable + template S, + weakly_incrementable O1, weakly_incrementable O2, + class Proj = identity, indirect_unary_predicate> Pred> + requires indirectly_copyable && indirectly_copyable constexpr partition_copy_result partition_copy(I first, S last, O1 out_true, O2 out_false, Pred pred, Proj proj = {}); - template, Proj>> Pred> - requires IndirectlyCopyable, O1> && - IndirectlyCopyable, O2> + indirect_unary_predicate, Proj>> Pred> + requires indirectly_copyable, O1> && + indirectly_copyable, O2> constexpr partition_copy_result, O1, O2> partition_copy(R&& r, O1 out_true, O2 out_false, Pred pred, Proj proj = {}); } @@ -2204,11 +2206,11 @@ Predicate pred); namespace ranges { - template S, class Proj = identity, - IndirectUnaryPredicate> Pred> + template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr I partition_point(I first, S last, Pred pred, Proj proj = {}); - template, Proj>> Pred> + template, Proj>> Pred> constexpr safe_iterator_t partition_point(R&& r, Pred pred, Proj proj = {}); } @@ -2244,16 +2246,16 @@ template using merge_result = binary_transform_result; - template S1, InputIterator I2, Sentinel S2, - WeaklyIncrementable O, class Comp = ranges::less, class Proj1 = identity, + template S1, input_iterator I2, sentinel_for S2, + weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> - requires Mergeable + requires mergeable constexpr merge_result merge(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template - requires Mergeable, iterator_t, O, Comp, Proj1, Proj2> + requires mergeable, iterator_t, O, Comp, Proj1, Proj2> constexpr merge_result, safe_iterator_t, O> merge(R1&& r1, R2&& r2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -2279,12 +2281,12 @@ BidirectionalIterator last, Compare comp); namespace ranges { - template S, class Comp = ranges::less, + template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); - template - requires Sortable, Comp, Proj> + template + requires sortable, Comp, Proj> safe_iterator_t inplace_merge(R&& r, iterator_t middle, Comp comp = {}, Proj proj = {}); @@ -2310,16 +2312,16 @@ Compare comp); namespace ranges { - template S1, InputIterator I2, Sentinel S2, + template S1, input_iterator I2, sentinel_for S2, class Proj1 = identity, class Proj2 = identity, - IndirectStrictWeakOrder, projected> Comp = + indirect_strict_weak_order, projected> Comp = ranges::less> constexpr bool includes(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template, Proj1>, - projected, Proj2>> Comp = ranges::less> + indirect_strict_weak_order, Proj1>, + projected, Proj2>> Comp = ranges::less> constexpr bool includes(R1&& r1, R2&& r2, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); } @@ -2353,16 +2355,16 @@ template using set_union_result = binary_transform_result; - template S1, InputIterator I2, Sentinel S2, - WeaklyIncrementable O, class Comp = ranges::less, + template S1, input_iterator I2, sentinel_for S2, + weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> - requires Mergeable + requires mergeable constexpr set_union_result set_union(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template - requires Mergeable, iterator_t, O, Comp, Proj1, Proj2> + requires mergeable, iterator_t, O, Comp, Proj1, Proj2> constexpr set_union_result, safe_iterator_t, O> set_union(R1&& r1, R2&& r2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -2397,16 +2399,16 @@ template using set_intersection_result = binary_transform_result; - template S1, InputIterator I2, Sentinel S2, - WeaklyIncrementable O, class Comp = ranges::less, + template S1, input_iterator I2, sentinel_for S2, + weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> - requires Mergeable + requires mergeable constexpr set_intersection_result set_intersection(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template - requires Mergeable, iterator_t, O, Comp, Proj1, Proj2> + requires mergeable, iterator_t, O, Comp, Proj1, Proj2> constexpr set_intersection_result, safe_iterator_t, O> set_intersection(R1&& r1, R2&& r2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -2441,16 +2443,16 @@ template using set_difference_result = copy_result; - template S1, InputIterator I2, Sentinel S2, - WeaklyIncrementable O, class Comp = ranges::less, + template S1, input_iterator I2, sentinel_for S2, + weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> - requires Mergeable + requires mergeable constexpr set_difference_result set_difference(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template - requires Mergeable, iterator_t, O, Comp, Proj1, Proj2> + requires mergeable, iterator_t, O, Comp, Proj1, Proj2> constexpr set_difference_result, O> set_difference(R1&& r1, R2&& r2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -2485,17 +2487,17 @@ template using set_symmetric_difference_result = binary_transform_result; - template S1, InputIterator I2, Sentinel S2, - WeaklyIncrementable O, class Comp = ranges::less, + template S1, input_iterator I2, sentinel_for S2, + weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> - requires Mergeable + requires mergeable constexpr set_symmetric_difference_result set_symmetric_difference(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template - requires Mergeable, iterator_t, O, Comp, Proj1, Proj2> + requires mergeable, iterator_t, O, Comp, Proj1, Proj2> constexpr set_symmetric_difference_result, safe_iterator_t, O> set_symmetric_difference(R1&& r1, R2&& r2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -2509,13 +2511,13 @@ Compare comp); namespace ranges { - template S, class Comp = ranges::less, + template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I push_heap(I first, S last, Comp comp = {}, Proj proj = {}); - template - requires Sortable, Comp, Proj> + template + requires sortable, Comp, Proj> constexpr safe_iterator_t push_heap(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2527,13 +2529,13 @@ Compare comp); namespace ranges { - template S, class Comp = ranges::less, + template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I pop_heap(I first, S last, Comp comp = {}, Proj proj = {}); - template - requires Sortable, Comp, Proj> + template + requires sortable, Comp, Proj> constexpr safe_iterator_t pop_heap(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2545,13 +2547,13 @@ Compare comp); namespace ranges { - template S, class Comp = ranges::less, + template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I make_heap(I first, S last, Comp comp = {}, Proj proj = {}); - template - requires Sortable, Comp, Proj> + template + requires sortable, Comp, Proj> constexpr safe_iterator_t make_heap(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2563,13 +2565,13 @@ Compare comp); namespace ranges { - template S, class Comp = ranges::less, + template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I sort_heap(I first, S last, Comp comp = {}, Proj proj = {}); - template - requires Sortable, Comp, Proj> + template + requires sortable, Comp, Proj> constexpr safe_iterator_t sort_heap(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2588,11 +2590,11 @@ Compare comp); namespace ranges { - template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> + template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr bool is_heap(I first, S last, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = ranges::less> + template, Proj>> Comp = ranges::less> constexpr bool is_heap(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2614,11 +2616,11 @@ Compare comp); namespace ranges { - template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> + template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr I is_heap_until(I first, S last, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = ranges::less> + template, Proj>> Comp = ranges::less> constexpr safe_iterator_t is_heap_until(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2634,14 +2636,14 @@ namespace ranges { template> Comp = ranges::less> + indirect_strict_weak_order> Comp = ranges::less> constexpr const T& min(const T& a, const T& b, Comp comp = {}, Proj proj = {}); - template> Comp = ranges::less> + template> Comp = ranges::less> constexpr T min(initializer_list r, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = ranges::less> - requires IndirectlyCopyableStorable, range_value_t*> + template, Proj>> Comp = ranges::less> + requires indirectly_copyable_storable, range_value_t*> constexpr range_value_t min(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2656,14 +2658,14 @@ namespace ranges { template> Comp = ranges::less> + indirect_strict_weak_order> Comp = ranges::less> constexpr const T& max(const T& a, const T& b, Comp comp = {}, Proj proj = {}); - template> Comp = ranges::less> + template> Comp = ranges::less> constexpr T max(initializer_list r, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = ranges::less> - requires IndirectlyCopyableStorable, range_value_t*> + template, Proj>> Comp = ranges::less> + requires indirectly_copyable_storable, range_value_t*> constexpr range_value_t max(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2683,29 +2685,29 @@ [[no_unique_address]] T max; template - requires ConvertibleTo + requires convertible_to operator minmax_result() const & { return {min, max}; } template - requires ConvertibleTo + requires convertible_to operator minmax_result() && { return {std::move(min), std::move(max)}; } }; template> Comp = ranges::less> + indirect_strict_weak_order> Comp = ranges::less> constexpr minmax_result minmax(const T& a, const T& b, Comp comp = {}, Proj proj = {}); - template> Comp = ranges::less> + template> Comp = ranges::less> constexpr minmax_result minmax(initializer_list r, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = ranges::less> - requires IndirectlyCopyableStorable, range_value_t*> + template, Proj>> Comp = ranges::less> + requires indirectly_copyable_storable, range_value_t*> constexpr minmax_result> minmax(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2724,11 +2726,11 @@ Compare comp); namespace ranges { - template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> + template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr I min_element(I first, S last, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = ranges::less> + template, Proj>> Comp = ranges::less> constexpr safe_iterator_t min_element(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2747,11 +2749,11 @@ Compare comp); namespace ranges { - template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> + template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr I max_element(I first, S last, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = ranges::less> + template, Proj>> Comp = ranges::less> constexpr safe_iterator_t max_element(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2775,12 +2777,12 @@ template using minmax_element_result = minmax_result; - template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> + template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr minmax_element_result minmax_element(I first, S last, Comp comp = {}, Proj proj = {}); - template, Proj>> Comp = ranges::less> + template, Proj>> Comp = ranges::less> constexpr minmax_element_result> minmax_element(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2815,17 +2817,17 @@ Compare comp); namespace ranges { - template S1, InputIterator I2, Sentinel S2, + template S1, input_iterator I2, sentinel_for S2, class Proj1 = identity, class Proj2 = identity, - IndirectStrictWeakOrder, projected> Comp = + indirect_strict_weak_order, projected> Comp = ranges::less> constexpr bool lexicographical_compare(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); - template, Proj1>, - projected, Proj2>> Comp = ranges::less> + indirect_strict_weak_order, Proj1>, + projected, Proj2>> Comp = ranges::less> constexpr bool lexicographical_compare(R1&& r1, R2&& r2, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -2858,14 +2860,14 @@ I in; }; - template S, class Comp = ranges::less, + template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr next_permutation_result next_permutation(I first, S last, Comp comp = {}, Proj proj = {}); - template - requires Sortable, Comp, Proj> + requires sortable, Comp, Proj> constexpr next_permutation_result> next_permutation(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2881,14 +2883,14 @@ template using prev_permutation_result = next_permutation_result; - template S, class Comp = ranges::less, + template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr prev_permutation_result prev_permutation(I first, S last, Comp comp = {}, Proj proj = {}); - template - requires Sortable, Comp, Proj> + requires sortable, Comp, Proj> constexpr prev_permutation_result> prev_permutation(R&& r, Comp comp = {}, Proj proj = {}); } @@ -2907,11 +2909,11 @@ bool all_of(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator last, Predicate pred); -template S, class Proj = identity, - IndirectUnaryPredicate> Pred> +template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr bool ranges::all_of(I first, S last, Pred pred, Proj proj = {}); -template, Proj>> Pred> +template, Proj>> Pred> constexpr bool ranges::all_of(R&& r, Pred pred, Proj proj = {}); \end{itemdecl} @@ -2941,11 +2943,11 @@ bool any_of(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator last, Predicate pred); -template S, class Proj = identity, - IndirectUnaryPredicate> Pred> +template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr bool ranges::any_of(I first, S last, Pred pred, Proj proj = {}); -template, Proj>> Pred> +template, Proj>> Pred> constexpr bool ranges::any_of(R&& r, Pred pred, Proj proj = {}); \end{itemdecl} @@ -2974,11 +2976,11 @@ bool none_of(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator last, Predicate pred); -template S, class Proj = identity, - IndirectUnaryPredicate> Pred> +template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr bool ranges::none_of(I first, S last, Pred pred, Proj proj = {}); -template, Proj>> Pred> +template, Proj>> Pred> constexpr bool ranges::none_of(R&& r, Pred pred, Proj proj = {}); \end{itemdecl} @@ -3081,12 +3083,12 @@ \indexlibrary{\idxcode{for_each}}% \begin{itemdecl} -template S, class Proj = identity, - IndirectUnaryInvocable> Fun> +template S, class Proj = identity, + indirectly_unary_invocable> Fun> constexpr ranges::for_each_result ranges::for_each(I first, S last, Fun f, Proj proj = {}); -template, Proj>> Fun> +template, Proj>> Fun> constexpr ranges::for_each_result, Fun> ranges::for_each(R&& r, Fun f, Proj proj = {}); \end{itemdecl} @@ -3117,7 +3119,7 @@ \pnum \begin{note} The overloads in namespace \tcode{ranges} require -\tcode{Fun} to model \libconcept{CopyConstructible}. +\tcode{Fun} to model \libconcept{copy_constructible}. \end{note} \end{itemdescr} @@ -3223,25 +3225,25 @@ ForwardIterator first, ForwardIterator last, Predicate pred); -template S, class T, class Proj = identity> - requires IndirectRelation, const T*> +template S, class T, class Proj = identity> + requires indirect_relation, const T*> constexpr I ranges::find(I first, S last, const T& value, Proj proj = {}); -template - requires IndirectRelation, Proj>, const T*> +template + requires indirect_relation, Proj>, const T*> constexpr safe_iterator_t ranges::find(R&& r, const T& value, Proj proj = {}); -template S, class Proj = identity, - IndirectUnaryPredicate> Pred> +template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr I ranges::find_if(I first, S last, Pred pred, Proj proj = {}); -template, Proj>> Pred> +template, Proj>> Pred> constexpr safe_iterator_t ranges::find_if(R&& r, Pred pred, Proj proj = {}); -template S, class Proj = identity, - IndirectUnaryPredicate> Pred> +template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr I ranges::find_if_not(I first, S last, Pred pred, Proj proj = {}); -template, Proj>> Pred> +template, Proj>> Pred> constexpr safe_iterator_t ranges::find_if_not(R&& r, Pred pred, Proj proj = {}); \end{itemdecl} @@ -3298,18 +3300,18 @@ ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); -template S1, ForwardIterator I2, Sentinel S2, +template S1, forward_iterator I2, sentinel_for S2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable + requires indirectly_comparable constexpr subrange ranges::find_end(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); -template - requires IndirectlyComparable, iterator_t, Pred, Proj1, Proj2> + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> constexpr safe_subrange_t ranges::find_end(R1&& r1, R2&& r2, Pred pred = {}, - Proj1 proj1 = {}, Proj2 proj2 = {}); + Proj1 proj1 = {}, Proj2 proj2 = {}); \end{itemdecl} \begin{itemdescr} @@ -3383,17 +3385,17 @@ ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); -template S1, ForwardIterator I2, Sentinel S2, +template S1, forward_iterator I2, sentinel_for S2, class Proj1 = identity, class Proj2 = identity, - IndirectRelation, - projected> Pred = ranges::equal_to> + indirect_relation, + projected> Pred = ranges::equal_to> constexpr I1 ranges::find_first_of(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); -template, Proj1>, - projected, Proj2>> Pred = ranges::equal_to> + indirect_relation, Proj1>, + projected, Proj2>> Pred = ranges::equal_to> constexpr safe_iterator_t ranges::find_first_of(R1&& r1, R2&& r2, Pred pred = {}, @@ -3450,11 +3452,11 @@ ForwardIterator first, ForwardIterator last, BinaryPredicate pred); -template S, class Proj = identity, - IndirectRelation> Pred = ranges::equal_to> +template S, class Proj = identity, + indirect_relation> Pred = ranges::equal_to> constexpr I ranges::adjacent_find(I first, S last, Pred pred = {}, Proj proj = {}); -template, Proj>> Pred = ranges::equal_to> +template, Proj>> Pred = ranges::equal_to> constexpr safe_iterator_t ranges::adjacent_find(R&& r, Pred pred = {}, Proj proj = {}); \end{itemdecl} @@ -3507,20 +3509,20 @@ count_if(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator last, Predicate pred); -template S, class T, class Proj = identity> - requires IndirectRelation, const T*> +template S, class T, class Proj = identity> + requires indirect_relation, const T*> constexpr iter_difference_t ranges::count(I first, S last, const T& value, Proj proj = {}); -template - requires IndirectRelation, Proj>, const T*> +template + requires indirect_relation, Proj>, const T*> constexpr range_difference_t ranges::count(R&& r, const T& value, Proj proj = {}); -template S, class Proj = identity, - IndirectUnaryPredicate> Pred> +template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr iter_difference_t ranges::count_if(I first, S last, Pred pred, Proj proj = {}); -template, Proj>> Pred> +template, Proj>> Pred> constexpr range_difference_t ranges::count_if(R&& r, Pred pred, Proj proj = {}); \end{itemdecl} @@ -3604,17 +3606,17 @@ ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); -template S1, InputIterator I2, Sentinel S2, +template S1, input_iterator I2, sentinel_for S2, class Proj1 = identity, class Proj2 = identity, - IndirectRelation, - projected> Pred = ranges::equal_to> + indirect_relation, + projected> Pred = ranges::equal_to> constexpr ranges::mismatch_result ranges::mismatch(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); -template, Proj1>, - projected, Proj2>> Pred = ranges::equal_to> + indirect_relation, Proj1>, + projected, Proj2>> Pred = ranges::equal_to> constexpr ranges::mismatch_result, safe_iterator_t> ranges::mismatch(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -3697,15 +3699,15 @@ ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred); -template S1, InputIterator I2, Sentinel S2, +template S1, input_iterator I2, sentinel_for S2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable + requires indirectly_comparable constexpr bool ranges::equal(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); -template - requires IndirectlyComparable, iterator_t, Pred, Proj1, Proj2> + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> constexpr bool ranges::equal(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); \end{itemdecl} @@ -3749,7 +3751,7 @@ \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators} for the overloads in namespace \tcode{std}, or \item - pairwise model \tcode{SizedSentinel}\iref{iterator.concept.sizedsentinel} + pairwise model \libconcept{sized_sentinel_for}\iref{iterator.concept.sizedsentinel} for the overloads in namespace \tcode{ranges}, \end{itemize} and \tcode{last1 - first1 != last2 - first2}, @@ -3828,16 +3830,16 @@ \indexlibrary{\idxcode{is_permutation}}% \begin{itemdecl} -template S1, ForwardIterator I2, - Sentinel S2, class Pred = ranges::equal_to, class Proj1 = identity, +template S1, forward_iterator I2, + sentinel_for S2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable + requires indirectly_comparable constexpr bool ranges::is_permutation(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); -template - requires IndirectlyComparable, iterator_t, Pred, Proj1, Proj2> + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> constexpr bool ranges::is_permutation(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); \end{itemdecl} @@ -3857,8 +3859,8 @@ \complexity No applications of the corresponding predicate and projections if: \begin{itemize} -\item \tcode{S1} and \tcode{I1} model \libconcept{SizedSentinel}, -\item \tcode{S2} and \tcode{I2} model \libconcept{SizedSentinel}, and +\item \tcode{S1} and \tcode{I1} model \tcode{\libconcept{sized_sentinel_for}}, +\item \tcode{S2} and \tcode{I2} model \tcode{\libconcept{sized_sentinel_for}}, and \item \tcode{last1 - first1 != last2 - first2}. \end{itemize} Otherwise, exactly \tcode{last1 - first1} applications @@ -3916,16 +3918,16 @@ \indexlibrary{\idxcode{search}}% \begin{itemdecl} -template S1, ForwardIterator I2, - Sentinel S2, class Pred = ranges::equal_to, +template S1, forward_iterator I2, + sentinel_for S2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable + requires indirectly_comparable constexpr subrange ranges::search(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); -template - requires IndirectlyComparable, iterator_t, Pred, Proj1, Proj2> + requires indirectly_comparable, iterator_t, Pred, Proj1, Proj2> constexpr safe_subrange_t ranges::search(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -4004,15 +4006,15 @@ \indexlibrary{\idxcode{search_n}}% \begin{itemdecl} -template S, class T, +template S, class T, class Pred = ranges::equal_to, class Proj = identity> - requires IndirectlyComparable + requires indirectly_comparable constexpr subrange ranges::search_n(I first, S last, iter_difference_t count, const T& value, Pred pred = {}, Proj proj = {}); -template - requires IndirectlyComparable, const T*, Pred, Proj> + requires indirectly_comparable, const T*, Pred, Proj> constexpr safe_subrange_t ranges::search_n(R&& r, range_difference_t count, const T& value, Pred pred = {}, Proj proj = {}); @@ -4061,11 +4063,11 @@ constexpr OutputIterator copy(InputIterator first, InputIterator last, OutputIterator result); -template S, WeaklyIncrementable O> - requires IndirectlyCopyable +template S, weakly_incrementable O> + requires indirectly_copyable constexpr ranges::copy_result ranges::copy(I first, S last, O result); -template - requires IndirectlyCopyable, O> +template + requires indirectly_copyable, O> constexpr ranges::copy_result, O> ranges::copy(R&& r, O result); \end{itemdecl} @@ -4139,8 +4141,8 @@ ForwardIterator1 first, Size n, ForwardIterator2 result); -template - requires IndirectlyCopyable +template + requires indirectly_copyable constexpr ranges::copy_n_result ranges::copy_n(I first, iter_difference_t n, O result); \end{itemdecl} @@ -4181,14 +4183,14 @@ ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 result, Predicate pred); -template S, WeaklyIncrementable O, class Proj = identity, - IndirectUnaryPredicate> Pred> - requires IndirectlyCopyable +template S, weakly_incrementable O, class Proj = identity, + indirect_unary_predicate> Pred> + requires indirectly_copyable constexpr ranges::copy_if_result ranges::copy_if(I first, S last, O result, Pred pred, Proj proj = {}); -template, Proj>> Pred> - requires IndirectlyCopyable, O> +template, Proj>> Pred> + requires indirectly_copyable, O> constexpr ranges::copy_if_result, O> ranges::copy_if(R&& r, O result, Pred pred, Proj proj = {}); \end{itemdecl} @@ -4253,12 +4255,12 @@ BidirectionalIterator1 last, BidirectionalIterator2 result); -template S1, BidirectionalIterator I2> - requires IndirectlyCopyable +template S1, bidirectional_iterator I2> + requires indirectly_copyable constexpr ranges::copy_backward_result ranges::copy_backward(I1 first, S1 last, I2 result); -template - requires IndirectlyCopyable, I> +template + requires indirectly_copyable, I> constexpr ranges::copy_backward_result, I> ranges::copy_backward(R&& r, I result); \end{itemdecl} @@ -4305,12 +4307,12 @@ constexpr OutputIterator move(InputIterator first, InputIterator last, OutputIterator result); -template S, WeaklyIncrementable O> - requires IndirectlyMovable +template S, weakly_incrementable O> + requires indirectly_movable constexpr ranges::move_result ranges::move(I first, S last, O result); -template - requires IndirectlyMovable, O> +template + requires indirectly_movable, O> constexpr ranges::move_result, O> ranges::move(R&& r, O result); \end{itemdecl} @@ -4395,12 +4397,12 @@ move_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, BidirectionalIterator2 result); -template S1, BidirectionalIterator I2> - requires IndirectlyMovable +template S1, bidirectional_iterator I2> + requires indirectly_movable constexpr ranges::move_backward_result ranges::move_backward(I1 first, S1 last, I2 result); -template - requires IndirectlyMovable, I> +template + requires indirectly_movable, I> constexpr ranges::move_backward_result, I> ranges::move_backward(R&& r, I result); \end{itemdecl} @@ -4462,12 +4464,12 @@ ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2); -template S1, InputIterator I2, Sentinel S2> - requires IndirectlySwappable +template S1, input_iterator I2, sentinel_for S2> + requires indirectly_swappable constexpr ranges::swap_ranges_result ranges::swap_ranges(I1 first1, S1 last1, I2 first2, S2 last2); -template - requires IndirectlySwappable, iterator_t> +template + requires indirectly_swappable, iterator_t> constexpr ranges::swap_ranges_result, safe_iterator_t> ranges::swap_ranges(R1&& r1, R2&& r2); \end{itemdecl} @@ -4565,27 +4567,27 @@ ForwardIterator2 first2, ForwardIterator result, BinaryOperation binary_op); -template S, WeaklyIncrementable O, - CopyConstructible F, class Proj = identity> - requires Writable>> +template S, weakly_incrementable O, + copy_constructible F, class Proj = identity> + requires writable>> constexpr ranges::unary_transform_result ranges::transform(I first1, S last1, O result, F op, Proj proj = {}); -template - requires Writable, Proj>>> + requires writable, Proj>>> constexpr ranges::unary_transform_result, O> ranges::transform(R&& r, O result, F op, Proj proj = {}); -template S1, InputIterator I2, Sentinel S2, - WeaklyIncrementable O, CopyConstructible F, class Proj1 = identity, +template S1, input_iterator I2, sentinel_for S2, + weakly_incrementable O, copy_constructible F, class Proj1 = identity, class Proj2 = identity> - requires Writable, + requires writable, projected>> constexpr ranges::binary_transform_result ranges::transform(I1 first1, S1 last1, I2 first2, S2 last2, O result, F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); -template - requires Writable, Proj1>, +template + requires writable, Proj1>, projected, Proj2>>> constexpr ranges::binary_transform_result, safe_iterator_t, O> ranges::transform(R1&& r1, R2&& r2, O result, @@ -4684,23 +4686,23 @@ ForwardIterator first, ForwardIterator last, Predicate pred, const T& new_value); -template S, class T1, class T2, class Proj = identity> - requires Writable && - IndirectRelation, const T1*> +template S, class T1, class T2, class Proj = identity> + requires writable && + indirect_relation, const T1*> constexpr I ranges::replace(I first, S last, const T1& old_value, const T2& new_value, Proj proj = {}); -template - requires Writable, const T2&> && - IndirectRelation, Proj>, const T1*> +template + requires writable, const T2&> && + indirect_relation, Proj>, const T1*> constexpr safe_iterator_t ranges::replace(R&& r, const T1& old_value, const T2& new_value, Proj proj = {}); -template S, class T, class Proj = identity, - IndirectUnaryPredicate> Pred> - requires Writable +template S, class T, class Proj = identity, + indirect_unary_predicate> Pred> + requires writable constexpr I ranges::replace_if(I first, S last, Pred pred, const T& new_value, Proj proj = {}); -template, Proj>> Pred> - requires Writable, const T&> +template, Proj>> Pred> + requires writable, const T&> constexpr safe_iterator_t ranges::replace_if(R&& r, Pred pred, const T& new_value, Proj proj = {}); \end{itemdecl} @@ -4763,30 +4765,30 @@ ForwardIterator2 result, Predicate pred, const T& new_value); -template S, class T1, class T2, OutputIterator O, +template S, class T1, class T2, output_iterator O, class Proj = identity> - requires IndirectlyCopyable && - IndirectRelation, const T1*> + requires indirectly_copyable && + indirect_relation, const T1*> constexpr ranges::replace_copy_result ranges::replace_copy(I first, S last, O result, const T1& old_value, const T2& new_value, Proj proj = {}); -template O, +template O, class Proj = identity> - requires IndirectlyCopyable, O> && - IndirectRelation, Proj>, const T1*> + requires indirectly_copyable, O> && + indirect_relation, Proj>, const T1*> constexpr ranges::replace_copy_result, O> ranges::replace_copy(R&& r, O result, const T1& old_value, const T2& new_value, Proj proj = {}); -template S, class T, OutputIterator O, - class Proj = identity, IndirectUnaryPredicate> Pred> - requires IndirectlyCopyable +template S, class T, output_iterator O, + class Proj = identity, indirect_unary_predicate> Pred> + requires indirectly_copyable constexpr ranges::replace_copy_if_result ranges::replace_copy_if(I first, S last, O result, Pred pred, const T& new_value, Proj proj = {}); -template O, class Proj = identity, - IndirectUnaryPredicate, Proj>> Pred> - requires IndirectlyCopyable, O> +template O, class Proj = identity, + indirect_unary_predicate, Proj>> Pred> + requires indirectly_copyable, O> constexpr ranges::replace_copy_if_result, O> ranges::replace_copy_if(R&& r, O result, Pred pred, const T& new_value, Proj proj = {}); @@ -4857,11 +4859,11 @@ ForwardIterator first, Size n, const T& value); -template O, Sentinel S> +template O, sentinel_for S> constexpr O ranges::fill(O first, S last, const T& value); -template R> +template R> constexpr safe_iterator_t ranges::fill(R&& r, const T& value); -template O> +template O> constexpr O ranges::fill_n(O first, iter_difference_t n, const T& value); \end{itemdecl} @@ -4910,14 +4912,14 @@ ForwardIterator generate_n(ExecutionPolicy&& exec, ForwardIterator first, Size n, Generator gen); -template S, CopyConstructible F> - requires Invocable && Writable> +template S, copy_constructible F> + requires invocable && writable> constexpr O ranges::generate(O first, S last, F gen); -template - requires Invocable && OutputRange> +template + requires invocable && output_range> constexpr safe_iterator_t ranges::generate(R&& r, F gen); -template - requires Invocable && Writable> +template + requires invocable && writable> constexpr O ranges::generate_n(O first, iter_difference_t n, F gen); \end{itemdecl} @@ -4966,20 +4968,20 @@ ForwardIterator first, ForwardIterator last, Predicate pred); -template S, class T, class Proj = identity> - requires IndirectRelation, const T*> +template S, class T, class Proj = identity> + requires indirect_relation, const T*> constexpr subrange ranges::remove(I first, S last, const T& value, Proj proj = {}); -template - requires Permutable> && - IndirectRelation, Proj>, const T*> +template + requires permutable> && + indirect_relation, Proj>, const T*> constexpr safe_subrange_t ranges::remove(R&& r, const T& value, Proj proj = {}); -template S, class Proj = identity, - IndirectUnaryPredicate> Pred> +template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr subrange ranges::remove_if(I first, S last, Pred pred, Proj proj = {}); -template, Proj>> Pred> - requires Permutable> +template, Proj>> Pred> + requires permutable> constexpr safe_subrange_t ranges::remove_if(R&& r, Pred pred, Proj proj = {}); \end{itemdecl} @@ -5057,25 +5059,25 @@ ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 result, Predicate pred); -template S, WeaklyIncrementable O, class T, +template S, weakly_incrementable O, class T, class Proj = identity> - requires IndirectlyCopyable && - IndirectRelation, const T*> + requires indirectly_copyable && + indirect_relation, const T*> constexpr ranges::remove_copy_result ranges::remove_copy(I first, S last, O result, const T& value, Proj proj = {}); -template - requires IndirectlyCopyable, O> && - IndirectRelation, Proj>, const T*> +template + requires indirectly_copyable, O> && + indirect_relation, Proj>, const T*> constexpr ranges::remove_copy_result, O> ranges::remove_copy(R&& r, O result, const T& value, Proj proj = {}); -template S, WeaklyIncrementable O, - class Proj = identity, IndirectUnaryPredicate> Pred> - requires IndirectlyCopyable +template S, weakly_incrementable O, + class Proj = identity, indirect_unary_predicate> Pred> + requires indirectly_copyable constexpr ranges::remove_copy_if_result ranges::remove_copy_if(I first, S last, O result, Pred pred, Proj proj = {}); -template, Proj>> Pred> - requires IndirectlyCopyable, O> +template, Proj>> Pred> + requires indirectly_copyable, O> constexpr ranges::remove_copy_if_result, O> ranges::remove_copy_if(R&& r, O result, Pred pred, Proj proj = {}); \end{itemdecl} @@ -5145,12 +5147,12 @@ ForwardIterator first, ForwardIterator last, BinaryPredicate pred); -template S, class Proj = identity, - IndirectRelation> C = ranges::equal_to> +template S, class Proj = identity, + indirect_relation> C = ranges::equal_to> constexpr subrange ranges::unique(I first, S last, C comp = {}, Proj proj = {}); -template, Proj>> C = ranges::equal_to> - requires Permutable> +template, Proj>> C = ranges::equal_to> + requires permutable> constexpr safe_subrange_t ranges::unique(R&& r, C comp = {}, Proj proj = {}); \end{itemdecl} @@ -5223,20 +5225,20 @@ ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 result, BinaryPredicate pred); -template S, WeaklyIncrementable O, - class Proj = identity, IndirectRelation> C = ranges::equal_to> - requires IndirectlyCopyable && - (ForwardIterator || - (InputIterator && Same, iter_value_t>) || - IndirectlyCopyableStorable) +template S, weakly_incrementable O, + class Proj = identity, indirect_relation> C = ranges::equal_to> + requires indirectly_copyable && + (forward_iterator || + (input_iterator && same_as, iter_value_t>) || + indirectly_copyable_storable) constexpr ranges::unique_copy_result ranges::unique_copy(I first, S last, O result, C comp = {}, Proj proj = {}); -template, Proj>> C = ranges::equal_to> - requires IndirectlyCopyable, O> && - (ForwardIterator> || - (InputIterator && Same, iter_value_t>) || - IndirectlyCopyableStorable, O>) +template, Proj>> C = ranges::equal_to> + requires indirectly_copyable, O> && + (forward_iterator> || + (input_iterator && same_as, iter_value_t>) || + indirectly_copyable_storable, O>) constexpr ranges::unique_copy_result, O> ranges::unique_copy(R&& r, O result, C comp = {}, Proj proj = {}); \end{itemdecl} @@ -5322,11 +5324,11 @@ void reverse(ExecutionPolicy&& exec, BidirectionalIterator first, BidirectionalIterator last); -template S> - requires Permutable +template S> + requires permutable constexpr I ranges::reverse(I first, S last); -template - requires Permutable> +template + requires permutable> constexpr safe_iterator_t ranges::reverse(R&& r); \end{itemdecl} @@ -5365,12 +5367,12 @@ BidirectionalIterator first, BidirectionalIterator last, ForwardIterator result); -template S, WeaklyIncrementable O> - requires IndirectlyCopyable +template S, weakly_incrementable O> + requires indirectly_copyable constexpr ranges::reverse_copy_result ranges::reverse_copy(I first, S last, O result); -template - requires IndirectlyCopyable, O> +template + requires indirectly_copyable, O> constexpr ranges::reverse_copy_result, O> ranges::reverse_copy(R&& r, O result); \end{itemdecl} @@ -5417,7 +5419,7 @@ rotate(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator middle, ForwardIterator last); -template S> +template S> constexpr subrange ranges::rotate(I first, I middle, S last); \end{itemdecl} @@ -5458,8 +5460,8 @@ \end{itemdescr} \begin{itemdecl} -template - requires Permutable> +template + requires permutable> constexpr safe_subrange_t ranges::rotate(R&& r, iterator_t middle); \end{itemdecl} @@ -5482,8 +5484,8 @@ ForwardIterator1 first, ForwardIterator1 middle, ForwardIterator1 last, ForwardIterator2 result); - template S, WeaklyIncrementable O> - requires IndirectlyCopyable + template S, weakly_incrementable O> + requires indirectly_copyable constexpr ranges::rotate_copy_result ranges::rotate_copy(I first, I middle, S last, O result); \end{itemdecl} @@ -5520,8 +5522,8 @@ \end{itemdescr} \begin{itemdecl} -template - requires IndirectlyCopyable, O> +template + requires indirectly_copyable, O> constexpr ranges::rotate_copy_result, O> ranges::rotate_copy(R&& r, iterator_t middle, O result); \end{itemdecl} @@ -5613,13 +5615,13 @@ RandomAccessIterator last, UniformRandomBitGenerator&& g); -template S, class Gen> - requires Permutable && - UniformRandomBitGenerator> +template S, class Gen> + requires permutable && + uniform_random_bit_generator> I ranges::shuffle(I first, S last, Gen&& g); -template - requires Permutable> && - UniformRandomBitGenerator> +template + requires permutable> && + uniform_random_bit_generator> safe_iterator_t ranges::shuffle(R&& r, Gen&& g); \end{itemdecl} @@ -5844,13 +5846,13 @@ RandomAccessIterator first, RandomAccessIterator last, Compare comp); -template S, class Comp = ranges::less, +template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I ranges::sort(I first, S last, Comp comp = {}, Proj proj = {}); -template - requires Sortable, Comp, Proj> +template + requires sortable, Comp, Proj> constexpr safe_iterator_t ranges::sort(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -5903,12 +5905,12 @@ RandomAccessIterator first, RandomAccessIterator last, Compare comp); -template S, class Comp = ranges::less, +template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable I ranges::stable_sort(I first, S last, Comp comp = {}, Proj proj = {}); -template - requires Sortable, Comp, Proj> +template + requires sortable, Comp, Proj> safe_iterator_t ranges::stable_sort(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -5975,9 +5977,9 @@ RandomAccessIterator last, Compare comp); -template S, class Comp = ranges::less, +template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I ranges::partial_sort(I first, I middle, S last, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -6019,8 +6021,8 @@ \end{itemdescr} \begin{itemdecl} -template - requires Sortable, Comp, Proj> +template + requires sortable, Comp, Proj> constexpr safe_iterator_t ranges::partial_sort(R&& r, iterator_t middle, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -6066,19 +6068,19 @@ RandomAccessIterator result_last, Compare comp); -template S1, RandomAccessIterator I2, Sentinel S2, +template S1, random_access_iterator I2, sentinel_for S2, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyCopyable && Sortable && - IndirectStrictWeakOrder, projected> + requires indirectly_copyable && sortable && + indirect_strict_weak_order, projected> constexpr ranges::partial_sort_copy_result ranges::partial_sort_copy(I1 first, S1 last, I2 result_first, S2 result_last, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); -template - requires IndirectlyCopyable, iterator_t> && - Sortable, Comp, Proj2> && - IndirectStrictWeakOrder, Proj1>, - projected, Proj2>> + requires indirectly_copyable, iterator_t> && + sortable, Comp, Proj2> && + indirect_strict_weak_order, Proj1>, + projected, Proj2>> constexpr ranges::partial_sort_copy_result, safe_iterator_t> ranges::partial_sort_copy(R1&& r, R2&& result_r, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -6204,11 +6206,11 @@ \indexlibrary{\idxcode{is_sorted}}% \begin{itemdecl} -template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> +template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr bool ranges::is_sorted(I first, S last, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = ranges::less> +template, Proj>> Comp = ranges::less> constexpr bool ranges::is_sorted(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -6239,11 +6241,11 @@ ForwardIterator first, ForwardIterator last, Compare comp); -template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> +template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr I ranges::is_sorted_until(I first, S last, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = ranges::less> +template, Proj>> Comp = ranges::less> constexpr safe_iterator_t ranges::is_sorted_until(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -6285,9 +6287,9 @@ RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp); -template S, class Comp = ranges::less, +template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I ranges::nth_element(I first, I nth, S last, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -6331,8 +6333,8 @@ \end{itemdescr} \begin{itemdecl} -template - requires Sortable, Comp, Proj> +template + requires sortable, Comp, Proj> constexpr safe_iterator_t ranges::nth_element(R&& r, iterator_t nth, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -6374,12 +6376,12 @@ lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); -template S, class T, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> +template S, class T, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr I ranges::lower_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = +template, Proj>> Comp = ranges::less> constexpr safe_iterator_t ranges::lower_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); @@ -6422,11 +6424,11 @@ upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); -template S, class T, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> +template S, class T, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr I ranges::upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = +template, Proj>> Comp = ranges::less> constexpr safe_iterator_t ranges::upper_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {}); @@ -6470,12 +6472,12 @@ ForwardIterator last, const T& value, Compare comp); -template S, class T, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> +template S, class T, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr subrange ranges::equal_range(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = +template, Proj>> Comp = ranges::less> constexpr safe_subrange_t ranges::equal_range(R&& r, const T& value, Comp comp = {}, Proj proj = {}); @@ -6534,12 +6536,12 @@ binary_search(ForwardIterator first, ForwardIterator last, const T& value, Compare comp); -template S, class T, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> +template S, class T, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr bool ranges::binary_search(I first, S last, const T& value, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = +template, Proj>> Comp = ranges::less> constexpr bool ranges::binary_search(R&& r, const T& value, Comp comp = {}, Proj proj = {}); @@ -6584,11 +6586,11 @@ bool is_partitioned(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator last, Predicate pred); -template S, class Proj = identity, - IndirectUnaryPredicate> Pred> +template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr bool ranges::is_partitioned(I first, S last, Pred pred, Proj proj = {}); -template, Proj>> Pred> +template, Proj>> Pred> constexpr bool ranges::is_partitioned(R&& r, Pred pred, Proj proj = {}); \end{itemdecl} @@ -6619,13 +6621,13 @@ partition(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator last, Predicate pred); -template S, class Proj = identity, - IndirectUnaryPredicate> Pred> +template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr subrange ranges::partition(I first, S last, Pred pred, Proj proj = {}); -template, Proj>> Pred> - requires Permutable> +template, Proj>> Pred> + requires permutable> constexpr safe_subrange_t ranges::partition(R&& r, Pred pred, Proj proj = {}); \end{itemdecl} @@ -6668,7 +6670,7 @@ At most $N / 2$ swaps if the type of \tcode{first} meets the \oldconcept{BidirectionalIterator} requirements for the overloads in namespace \tcode{std} or - models \libconcept{BidirectionalIterator} + models \libconcept{bidirectional_iterator} for the overloads in namespace \tcode{ranges}, and at most $N$ swaps otherwise. \item @@ -6688,13 +6690,13 @@ stable_partition(ExecutionPolicy&& exec, BidirectionalIterator first, BidirectionalIterator last, Predicate pred); -template S, class Proj = identity, - IndirectUnaryPredicate> Pred> - requires Permutable +template S, class Proj = identity, + indirect_unary_predicate> Pred> + requires permutable subrange ranges::stable_partition(I first, S last, Pred pred, Proj proj = {}); -template, Proj>> Pred> - requires Permutable> +template, Proj>> Pred> + requires permutable> safe_subrange_t ranges::stable_partition(R&& r, Pred pred, Proj proj = {}); \end{itemdecl} @@ -6760,17 +6762,17 @@ ForwardIterator first, ForwardIterator last, ForwardIterator1 out_true, ForwardIterator2 out_false, Predicate pred); -template S, WeaklyIncrementable O1, WeaklyIncrementable O2, - class Proj = identity, IndirectUnaryPredicate> Pred> - requires IndirectlyCopyable && IndirectlyCopyable +template S, weakly_incrementable O1, weakly_incrementable O2, + class Proj = identity, indirect_unary_predicate> Pred> + requires indirectly_copyable && indirectly_copyable constexpr ranges::partition_copy_result ranges::partition_copy(I first, S last, O1 out_true, O2 out_false, Pred pred, - Proj proj = {}); -template, Proj>> Pred> - requires IndirectlyCopyable, O1> && - IndirectlyCopyable, O2> + indirect_unary_predicate, Proj>> Pred> + requires indirectly_copyable, O1> && + indirectly_copyable, O2> constexpr ranges::partition_copy_result, O1, O2> ranges::partition_copy(R&& r, O1 out_true, O2 out_false, Pred pred, Proj proj = {}); \end{itemdecl} @@ -6822,11 +6824,11 @@ constexpr ForwardIterator partition_point(ForwardIterator first, ForwardIterator last, Predicate pred); -template S, class Proj = identity, - IndirectUnaryPredicate> Pred> +template S, class Proj = identity, + indirect_unary_predicate> Pred> constexpr I ranges::partition_point(I first, S last, Pred pred, Proj proj = {}); -template, Proj>> Pred> +template, Proj>> Pred> constexpr safe_iterator_t ranges::partition_point(R&& r, Pred pred, Proj proj = {}); \end{itemdecl} @@ -6887,16 +6889,16 @@ ForwardIterator2 first2, ForwardIterator2 last2, ForwardIterator result, Compare comp); -template S1, InputIterator I2, Sentinel S2, - WeaklyIncrementable O, class Comp = ranges::less, class Proj1 = identity, +template S1, input_iterator I2, sentinel_for S2, + weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> - requires Mergeable + requires mergeable constexpr ranges::merge_result ranges::merge(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); -template - requires Mergeable, iterator_t, O, Comp, Proj1, Proj2> + requires mergeable, iterator_t, O, Comp, Proj1, Proj2> constexpr ranges::merge_result, safe_iterator_t, O> ranges::merge(R1&& r1, R2&& r2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -6978,9 +6980,9 @@ BidirectionalIterator middle, BidirectionalIterator last, Compare comp); -template S, class Comp = ranges::less, +template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable I ranges::inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -7030,8 +7032,8 @@ \end{itemdescr} \begin{itemdecl} -template - requires Sortable, Comp, Proj> +template + requires sortable, Comp, Proj> safe_iterator_t ranges::inplace_merge(R&& r, iterator_t middle, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -7078,16 +7080,16 @@ ForwardIterator2 first2, ForwardIterator2 last2, Compare comp); -template S1, InputIterator I2, Sentinel S2, +template S1, input_iterator I2, sentinel_for S2, class Proj1 = identity, class Proj2 = identity, - IndirectStrictWeakOrder, - projected> Comp = ranges::less> + indirect_strict_weak_order, + projected> Comp = ranges::less> constexpr bool ranges::includes(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); -template, Proj1>, - projected, Proj2>> Comp = ranges::less> + indirect_strict_weak_order, Proj1>, + projected, Proj2>> Comp = ranges::less> constexpr bool ranges::includes(R1&& r1, R2&& r2, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); \end{itemdecl} @@ -7152,16 +7154,16 @@ ForwardIterator2 first2, ForwardIterator2 last2, ForwardIterator result, Compare comp); -template S1, InputIterator I2, Sentinel S2, - WeaklyIncrementable O, class Comp = ranges::less, +template S1, input_iterator I2, sentinel_for S2, + weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> - requires Mergeable + requires mergeable constexpr ranges::set_union_result ranges::set_union(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); -template - requires Mergeable, iterator_t, O, Comp, Proj1, Proj2> + requires mergeable, iterator_t, O, Comp, Proj1, Proj2> constexpr ranges::set_union_result, safe_iterator_t, O> ranges::set_union(R1&& r1, R2&& r2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -7247,16 +7249,16 @@ ForwardIterator2 first2, ForwardIterator2 last2, ForwardIterator result, Compare comp); -template S1, InputIterator I2, Sentinel S2, - WeaklyIncrementable O, class Comp = ranges::less, +template S1, input_iterator I2, sentinel_for S2, + weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> - requires Mergeable + requires mergeable constexpr ranges::set_intersection_result ranges::set_intersection(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); -template - requires Mergeable, iterator_t, O, Comp, Proj1, Proj2> + requires mergeable, iterator_t, O, Comp, Proj1, Proj2> constexpr ranges::set_intersection_result, safe_iterator_t, O> ranges::set_intersection(R1&& r1, R2&& r2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -7340,16 +7342,16 @@ ForwardIterator2 first2, ForwardIterator2 last2, ForwardIterator result, Compare comp); -template S1, InputIterator I2, Sentinel S2, - WeaklyIncrementable O, class Comp = ranges::less, +template S1, input_iterator I2, sentinel_for S2, + weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> - requires Mergeable + requires mergeable constexpr ranges::set_difference_result ranges::set_difference(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); -template - requires Mergeable, iterator_t, O, Comp, Proj1, Proj2> + requires mergeable, iterator_t, O, Comp, Proj1, Proj2> constexpr ranges::set_difference_result, O> ranges::set_difference(R1&& r1, R2&& r2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -7434,17 +7436,17 @@ ForwardIterator2 first2, ForwardIterator2 last2, ForwardIterator result, Compare comp); -template S1, InputIterator I2, Sentinel S2, - WeaklyIncrementable O, class Comp = ranges::less, +template S1, input_iterator I2, sentinel_for S2, + weakly_incrementable O, class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity> - requires Mergeable + requires mergeable constexpr ranges::set_symmetric_difference_result ranges::set_symmetric_difference(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); -template - requires Mergeable, iterator_t, O, Comp, Proj1, Proj2> + requires mergeable, iterator_t, O, Comp, Proj1, Proj2> constexpr ranges::set_symmetric_difference_result, safe_iterator_t, O> ranges::set_symmetric_difference(R1&& r1, R2&& r2, O result, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -7541,13 +7543,13 @@ constexpr void push_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); -template S, class Comp = ranges::less, +template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I ranges::push_heap(I first, S last, Comp comp = {}, Proj proj = {}); -template - requires Sortable, Comp, Proj> +template + requires sortable, Comp, Proj> constexpr safe_iterator_t ranges::push_heap(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -7592,13 +7594,13 @@ constexpr void pop_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); -template S, class Comp = ranges::less, +template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I ranges::pop_heap(I first, S last, Comp comp = {}, Proj proj = {}); -template - requires Sortable, Comp, Proj> +template + requires sortable, Comp, Proj> constexpr safe_iterator_t ranges::pop_heap(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -7650,13 +7652,13 @@ constexpr void make_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); -template S, class Comp = ranges::less, +template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I ranges::make_heap(I first, S last, Comp comp = {}, Proj proj = {}); -template - requires Sortable, Comp, Proj> +template + requires sortable, Comp, Proj> constexpr safe_iterator_t ranges::make_heap(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -7699,13 +7701,13 @@ constexpr void sort_heap(RandomAccessIterator first, RandomAccessIterator last, Compare comp); -template S, class Comp = ranges::less, +template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr I ranges::sort_heap(I first, S last, Comp comp = {}, Proj proj = {}); -template - requires Sortable, Comp, Proj> +template + requires sortable, Comp, Proj> constexpr safe_iterator_t ranges::sort_heap(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -7804,11 +7806,11 @@ \indexlibrary{\idxcode{is_heap}}% \begin{itemdecl} -template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> +template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr bool ranges::is_heap(I first, S last, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = ranges::less> +template, Proj>> Comp = ranges::less> constexpr bool ranges::is_heap(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -7839,11 +7841,11 @@ RandomAccessIterator first, RandomAccessIterator last, Compare comp); -template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> +template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr I ranges::is_heap_until(I first, S last, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = ranges::less> +template, Proj>> Comp = ranges::less> constexpr safe_iterator_t ranges::is_heap_until(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -7876,7 +7878,7 @@ constexpr const T& min(const T& a, const T& b, Compare comp); template> Comp = ranges::less> + indirect_strict_weak_order> Comp = ranges::less> constexpr const T& ranges::min(const T& a, const T& b, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -7909,12 +7911,12 @@ template constexpr T min(initializer_list r, Compare comp); -template> Comp = ranges::less> +template> Comp = ranges::less> constexpr T ranges::min(initializer_list r, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = ranges::less> - requires IndirectlyCopyableStorable, range_value_t*> +template, Proj>> Comp = ranges::less> + requires indirectly_copyable_storable, range_value_t*> constexpr range_value_t ranges::min(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -7953,7 +7955,7 @@ constexpr const T& max(const T& a, const T& b, Compare comp); template> Comp = ranges::less> + indirect_strict_weak_order> Comp = ranges::less> constexpr const T& ranges::max(const T& a, const T& b, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -7986,12 +7988,12 @@ template constexpr T max(initializer_list r, Compare comp); -template> Comp = ranges::less> +template> Comp = ranges::less> constexpr T ranges::max(initializer_list r, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = ranges::less> - requires IndirectlyCopyableStorable, range_value_t*> +template, Proj>> Comp = ranges::less> + requires indirectly_copyable_storable, range_value_t*> constexpr range_value_t ranges::max(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -8030,7 +8032,7 @@ constexpr pair minmax(const T& a, const T& b, Compare comp); template> Comp = ranges::less> + indirect_strict_weak_order> Comp = ranges::less> constexpr ranges::minmax_result ranges::minmax(const T& a, const T& b, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -8065,13 +8067,13 @@ template constexpr pair minmax(initializer_list t, Compare comp); -template> Comp = ranges::less> +template> Comp = ranges::less> constexpr ranges::minmax_result ranges::minmax(initializer_list r, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = ranges::less> - requires IndirectlyCopyableStorable, range_value_t*> +template, Proj>> Comp = ranges::less> + requires indirectly_copyable_storable, range_value_t*> constexpr ranges::minmax_result> ranges::minmax(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -8122,11 +8124,11 @@ ForwardIterator first, ForwardIterator last, Compare comp); -template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> +template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr I ranges::min_element(I first, S last, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = ranges::less> +template, Proj>> Comp = ranges::less> constexpr safe_iterator_t ranges::min_element(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -8169,11 +8171,11 @@ ForwardIterator first, ForwardIterator last, Compare comp); -template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> +template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr I ranges::max_element(I first, S last, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = ranges::less> +template, Proj>> Comp = ranges::less> constexpr safe_iterator_t ranges::max_element(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -8218,12 +8220,12 @@ minmax_element(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator last, Compare comp); -template S, class Proj = identity, - IndirectStrictWeakOrder> Comp = ranges::less> +template S, class Proj = identity, + indirect_strict_weak_order> Comp = ranges::less> constexpr ranges::minmax_result ranges::minmax_element(I first, S last, Comp comp = {}, Proj proj = {}); -template, Proj>> Comp = ranges::less> +template, Proj>> Comp = ranges::less> constexpr ranges::minmax_result> ranges::minmax_element(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -8306,17 +8308,17 @@ ForwardIterator2 first2, ForwardIterator2 last2, Compare comp); -template S1, InputIterator I2, Sentinel S2, +template S1, input_iterator I2, sentinel_for S2, class Proj1 = identity, class Proj2 = identity, - IndirectStrictWeakOrder, - projected> Comp = ranges::less> + indirect_strict_weak_order, + projected> Comp = ranges::less> constexpr bool ranges::lexicographical_compare(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); -template, Proj1>, - projected, Proj2>> Comp = ranges::less> + indirect_strict_weak_order, Proj1>, + projected, Proj2>> Comp = ranges::less> constexpr bool ranges::lexicographical_compare(R1&& r1, R2&& r2, Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); @@ -8428,14 +8430,14 @@ constexpr bool next_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); -template S, class Comp = ranges::less, +template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr ranges::next_permutation_result ranges::next_permutation(I first, S last, Comp comp = {}, Proj proj = {}); -template - requires Sortable, Comp, Proj> + requires sortable, Comp, Proj> constexpr ranges::next_permutation_result> ranges::next_permutation(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} @@ -8487,14 +8489,14 @@ constexpr bool prev_permutation(BidirectionalIterator first, BidirectionalIterator last, Compare comp); -template S, class Comp = ranges::less, +template S, class Comp = ranges::less, class Proj = identity> - requires Sortable + requires sortable constexpr ranges::prev_permutation_result ranges::prev_permutation(I first, S last, Comp comp = {}, Proj proj = {}); -template - requires Sortable, Comp, Proj> + requires sortable, Comp, Proj> constexpr ranges::prev_permutation_result> ranges::prev_permutation(R&& r, Comp comp = {}, Proj proj = {}); \end{itemdecl} diff --git a/source/concepts.tex b/source/concepts.tex index e53055af7a..b94f4cce6f 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -147,118 +147,118 @@ \begin{codeblock} namespace std { // \ref{concepts.lang}, language-related concepts - // \ref{concept.same}, concept \libconcept{Same} + // \ref{concept.same}, concept \libconcept{same_as} template - concept Same = @\seebelow@; + concept same_as = @\seebelow@; - // \ref{concept.derivedfrom}, concept \libconcept{DerivedFrom} + // \ref{concept.derived}, concept \libconcept{derived_from} template - concept DerivedFrom = @\seebelow@; + concept derived_from = @\seebelow@; - // \ref{concept.convertibleto}, concept \libconcept{ConvertibleTo} + // \ref{concept.convertible}, concept \libconcept{convertible_to} template - concept ConvertibleTo = @\seebelow@; + concept convertible_to = @\seebelow@; - // \ref{concept.commonref}, concept \libconcept{CommonReference} + // \ref{concept.commonref}, concept \libconcept{common_reference_with} template - concept CommonReference = @\seebelow@; + concept common_reference_with = @\seebelow@; - // \ref{concept.common}, concept \libconcept{Common} + // \ref{concept.common}, concept \libconcept{common_with} template - concept Common = @\seebelow@; + concept common_with = @\seebelow@; // \ref{concepts.arithmetic}, arithmetic concepts template - concept Integral = @\seebelow@; + concept integral = @\seebelow@; template - concept SignedIntegral = @\seebelow@; + concept signed_integral = @\seebelow@; template - concept UnsignedIntegral = @\seebelow@; + concept unsigned_integral = @\seebelow@; template - concept FloatingPoint = @\seebelow@; + concept floating_point = @\seebelow@; - // \ref{concept.assignable}, concept \libconcept{Assignable} + // \ref{concept.assignable}, concept \libconcept{assignable_from} template - concept Assignable = @\seebelow@; + concept assignable_from = @\seebelow@; - // \ref{concept.swappable}, concept \libconcept{Swappable} + // \ref{concept.swappable}, concept \libconcept{swappable} namespace ranges { inline namespace @\unspec@ { inline constexpr @\unspec@ swap = @\unspec@; } } template - concept Swappable = @\seebelow@; + concept swappable = @\seebelow@; template - concept SwappableWith = @\seebelow@; + concept swappable_with = @\seebelow@; - // \ref{concept.destructible}, concept \libconcept{Destructible} + // \ref{concept.destructible}, concept \libconcept{destructible} template - concept Destructible = @\seebelow@; + concept destructible = @\seebelow@; - // \ref{concept.constructible}, concept \libconcept{Constructible} + // \ref{concept.constructible}, concept \libconcept{constructible_from} template - concept Constructible = @\seebelow@; + concept constructible_from = @\seebelow@; - // \ref{concept.defaultconstructible}, concept \libconcept{DefaultConstructible} + // \ref{concept.defaultconstructible}, concept \libconcept{default_constructible} template - concept DefaultConstructible = @\seebelow@; + concept default_constructible = @\seebelow@; - // \ref{concept.moveconstructible}, concept \libconcept{MoveConstructible} + // \ref{concept.moveconstructible}, concept \libconcept{move_constructible} template - concept MoveConstructible = @\seebelow@; + concept move_constructible = @\seebelow@; - // \ref{concept.copyconstructible}, concept \libconcept{CopyConstructible} + // \ref{concept.copyconstructible}, concept \libconcept{copy_constructible} template - concept CopyConstructible = @\seebelow@; + concept copy_constructible = @\seebelow@; // \ref{concepts.compare}, comparison concepts - // \ref{concept.boolean}, concept \libconcept{Boolean} + // \ref{concept.boolean}, concept \libconcept{boolean} template - concept Boolean = @\seebelow@; + concept boolean = @\seebelow@; - // \ref{concept.equalitycomparable}, concept \libconcept{EqualityComparable} + // \ref{concept.equalitycomparable}, concept \libconcept{equality_comparable} template - concept EqualityComparable = @\seebelow@; + concept equality_comparable = @\seebelow@; template - concept EqualityComparableWith = @\seebelow@; + concept equality_comparable_with = @\seebelow@; - // \ref{concept.stricttotallyordered}, concept \libconcept{StrictTotallyOrdered} + // \ref{concept.totallyordered}, concept \libconcept{totally_ordered} template - concept StrictTotallyOrdered = @\seebelow@; + concept totally_ordered = @\seebelow@; template - concept StrictTotallyOrderedWith = @\seebelow@; + concept totally_ordered_with = @\seebelow@; // \ref{concepts.object}, object concepts template - concept Movable = @\seebelow@; + concept movable = @\seebelow@; template - concept Copyable = @\seebelow@; + concept copyable = @\seebelow@; template - concept Semiregular = @\seebelow@; + concept semiregular = @\seebelow@; template - concept Regular = @\seebelow@; + concept regular = @\seebelow@; // \ref{concepts.callable}, callable concepts - // \ref{concept.invocable}, concept \libconcept{Invocable} + // \ref{concept.invocable}, concept \libconcept{invocable} template - concept Invocable = @\seebelow@; + concept invocable = @\seebelow@; - // \ref{concept.regularinvocable}, concept \libconcept{RegularInvocable} + // \ref{concept.regularinvocable}, concept \libconcept{regular_invocable} template - concept RegularInvocable = @\seebelow@; + concept regular_invocable = @\seebelow@; - // \ref{concept.predicate}, concept \libconcept{Predicate} + // \ref{concept.predicate}, concept \libconcept{predicate} template - concept Predicate = @\seebelow@; + concept predicate = @\seebelow@; - // \ref{concept.relation}, concept \libconcept{Relation} + // \ref{concept.relation}, concept \libconcept{relation} template - concept Relation = @\seebelow@; + concept relation = @\seebelow@; - // \ref{concept.strictweakorder}, concept \libconcept{StrictWeakOrder} + // \ref{concept.strictweakorder}, concept \libconcept{strict_weak_order} template - concept StrictWeakOrder = @\seebelow@; + concept strict_weak_order = @\seebelow@; } \end{codeblock} @@ -271,31 +271,31 @@ features. These concepts express relationships between types, type classifications, and fundamental type properties. -\rSec2[concept.same]{Concept \libconcept{Same}} +\rSec2[concept.same]{Concept \libconcept{same_as}} -\indexlibrary{\idxcode{Same}}% +\indexlibrary{\idxcode{same_as}}% \begin{itemdecl} template - concept @\placeholdernc{same-impl}@ = is_same_v; // \expos + concept @\placeholdernc{same-as-impl}@ = is_same_v; // \expos template - concept Same = @\placeholdernc{same-impl}@ && @\placeholdernc{same-impl}@; + concept same_as = @\placeholdernc{same-as-impl}@ && @\placeholdernc{same-as-impl}@; \end{itemdecl} \begin{itemdescr} \pnum \begin{note} -\tcode{\libconcept{Same}} subsumes \tcode{\libconcept{Same}} and +\tcode{\libconcept{same_as}} subsumes \tcode{\libconcept{same_as}} and vice versa. \end{note} \end{itemdescr} -\rSec2[concept.derivedfrom]{Concept \libconcept{DerivedFrom}} +\rSec2[concept.derived]{Concept \libconcept{derived_from}} -\indexlibrary{\idxcode{DerivedFrom}}% +\indexlibrary{\idxcode{derived_from}}% \begin{itemdecl} template - concept DerivedFrom = + concept derived_from = is_base_of_v && is_convertible_v; \end{itemdecl} @@ -303,24 +303,24 @@ \begin{itemdescr} \pnum \begin{note} -\tcode{\libconcept{DerivedFrom}} is satisfied if and only if +\tcode{\libconcept{derived_from}} is satisfied if and only if \tcode{Derived} is publicly and unambiguously derived from \tcode{Base}, or \tcode{Derived} and \tcode{Base} are the same class type ignoring cv-qualifiers. \end{note} \end{itemdescr} -\rSec2[concept.convertibleto]{Concept \libconcept{ConvertibleTo}} +\rSec2[concept.convertible]{Concept \libconcept{convertible_to}} \pnum -The \libconcept{ConvertibleTo} concept requires an expression of a particular +The \libconcept{convertible_to} concept requires an expression of a particular type and value category to be both implicitly and explicitly convertible to some other type. The implicit and explicit conversions are required to produce equal results. -\indexlibrary{\idxcode{ConvertibleTo}}% +\indexlibrary{\idxcode{convertible_to}}% \begin{itemdecl} template - concept ConvertibleTo = + concept convertible_to = is_convertible_v && requires(From (&f)()) { static_cast(f()); @@ -338,7 +338,7 @@ for some types \tcode{From} and \tcode{To}, and let \tcode{f} be a function with no arguments and return type \tcode{From} such that \tcode{f()} is equality-preserving. -\tcode{From} and \tcode{To} model \tcode{\libconcept{ConvertibleTo}} +\tcode{From} and \tcode{To} model \tcode{\libconcept{convertible_to}} only if: \begin{itemize} @@ -363,14 +363,14 @@ \end{itemdescr} -\rSec2[concept.commonref]{Concept \libconcept{CommonReference}} +\rSec2[concept.commonref]{Concept \libconcept{common_reference_with}} \pnum For two types \tcode{T} and \tcode{U}, if \tcode{common_reference_t} is well-formed and denotes a type \tcode{C} such that both -\tcode{\libconcept{ConvertibleTo}} +\tcode{\libconcept{convertible_to}} and -\tcode{\libconcept{ConvertibleTo}} +\tcode{\libconcept{convertible_to}} are modeled, then \tcode{T} and \tcode{U} share a \term{common reference type}, \tcode{C}. \begin{note} @@ -378,13 +378,13 @@ different type. \tcode{C} may be a reference type. \end{note} -\indexlibrary{\idxcode{CommonReference}}% +\indexlibrary{\idxcode{common_reference_with}}% \begin{itemdecl} template - concept CommonReference = - Same, common_reference_t> && - ConvertibleTo> && - ConvertibleTo>; + concept common_reference_with = + same_as, common_reference_t> && + convertible_to> && + convertible_to>; \end{itemdecl} \begin{itemdescr} @@ -395,7 +395,7 @@ \tcode{decltype((t1))} and \tcode{decltype((t2))} are each \tcode{T}, and let \tcode{u1} and \tcode{u2} be equality-preserving expressions such that \tcode{decltype((u1))} and \tcode{decltype((u2))} are each \tcode{U}. -\tcode{T} and \tcode{U} model \tcode{\libconcept{CommonReference}} +\tcode{T} and \tcode{U} model \tcode{\libconcept{common_reference_with}} only if: \begin{itemize} \item \tcode{C(t1)} equals \tcode{C(t2)} if and only if @@ -406,12 +406,12 @@ \pnum \begin{note} -Users can customize the behavior of \libconcept{CommonReference} by specializing +Users can customize the behavior of \libconcept{common_reference_with} by specializing the \tcode{basic_common_reference} class template\iref{meta.trans.other}. \end{note} \end{itemdescr} -\rSec2[concept.common]{Concept \libconcept{Common}} +\rSec2[concept.common]{Concept \libconcept{common_with}} \pnum If \tcode{T} and \tcode{U} can both be explicitly converted to some third type, @@ -422,19 +422,19 @@ different type. \tcode{C} might not be unique. \end{note} -\indexlibrary{\idxcode{Common}}% +\indexlibrary{\idxcode{common_with}}% \begin{itemdecl} template - concept Common = - Same, common_type_t> && + concept common_with = + same_as, common_type_t> && requires { static_cast>(declval()); static_cast>(declval()); } && - CommonReference< + common_reference_with< add_lvalue_reference_t, add_lvalue_reference_t> && - CommonReference< + common_reference_with< add_lvalue_reference_t>, common_reference_t< add_lvalue_reference_t, @@ -449,7 +449,7 @@ \tcode{decltype((t1))} and \tcode{decltype((t2))} are each \tcode{T}, and let \tcode{u1} and \tcode{u2} be equality-preserving expressions such that \tcode{decltype((u1))} and \tcode{decltype((u2))} are each \tcode{U}. -\tcode{T} and \tcode{U} model \tcode{\libconcept{Common}} +\tcode{T} and \tcode{U} model \tcode{\libconcept{common_with}} only if: \begin{itemize} \item \tcode{C(t1)} equals \tcode{C(t2)} if and only if @@ -460,7 +460,7 @@ \pnum \begin{note} -Users can customize the behavior of \libconcept{Common} by specializing the +Users can customize the behavior of \libconcept{common_with} by specializing the \tcode{common_type} class template\iref{meta.trans.other}. \end{note} @@ -468,44 +468,44 @@ \rSec2[concepts.arithmetic]{Arithmetic concepts} -\indexlibrary{\idxcode{Integral}}% -\indexlibrary{\idxcode{SignedIntegral}}% -\indexlibrary{\idxcode{UnsignedIntegral}}% +\indexlibrary{\idxcode{integral}}% +\indexlibrary{\idxcode{signed_integral}}% +\indexlibrary{\idxcode{unsigned_integral}}% \begin{itemdecl} template - concept Integral = is_integral_v; + concept integral = is_integral_v; template - concept SignedIntegral = Integral && is_signed_v; + concept signed_integral = integral && is_signed_v; template - concept UnsignedIntegral = Integral && !SignedIntegral; + concept unsigned_integral = integral && !signed_integral; template - concept FloatingPoint = is_floating_point_v; + concept floating_point = is_floating_point_v; \end{itemdecl} \begin{itemdescr} \pnum \begin{note} -\libconcept{SignedIntegral} can be modeled even by types that are +\libconcept{signed_integral} can be modeled even by types that are not signed integral types\iref{basic.fundamental}; for example, \tcode{char}. \end{note} \pnum \begin{note} -\libconcept{UnsignedIntegral} can be modeled even by types that are +\libconcept{unsigned_integral} can be modeled even by types that are not unsigned integral types\iref{basic.fundamental}; for example, \tcode{bool}. \end{note} \end{itemdescr} -\rSec2[concept.assignable]{Concept \libconcept{Assignable}} +\rSec2[concept.assignable]{Concept \libconcept{assignable_from}} -\indexlibrary{\idxcode{Assignable}}% +\indexlibrary{\idxcode{assignable_from}}% \begin{itemdecl} template - concept Assignable = + concept assignable_from = is_lvalue_reference_v && - CommonReference&, const remove_reference_t&> && + common_reference_with&, const remove_reference_t&> && requires(LHS lhs, RHS&& rhs) { - { lhs = std::forward(rhs) } -> Same; + { lhs = std::forward(rhs) } -> same_as; }; \end{itemdecl} @@ -520,7 +520,7 @@ \item \tcode{rcopy} be a distinct object that is equal to \tcode{rhs}. \end{itemize} \tcode{LHS} and \tcode{RHS} model -\tcode{\libconcept{Assignable}} only if +\tcode{\libconcept{assignable_from}} only if \begin{itemize} \item \tcode{addressof(lhs = rhs) == addressof(lcopy)}. @@ -548,7 +548,7 @@ \end{note} \end{itemdescr} -\rSec2[concept.swappable]{Concept \libconcept{Swappable}} +\rSec2[concept.swappable]{Concept \libconcept{swappable}} \pnum Let \tcode{t1} and \tcode{t2} be equality-preserving expressions that denote @@ -565,7 +565,7 @@ is that \tcode{t1} equals \tcode{u2} and \tcode{u1} equals \tcode{t2}. \item If \tcode{T} and \tcode{U} are different types that model - \libconcept{CommonReference}, + \tcode{\libconcept{common_reference_with}}, the result of the operation is that \tcode{C(t1)} equals \tcode{C(u2)} and @@ -609,8 +609,8 @@ \item Otherwise, if \tcode{E1} and \tcode{E2} are lvalues of the - same type \tcode{T} that models \libconcept{MoveConstructible} and - \libconcept{Assignable}, + same type \tcode{T} that models \tcode{\libconcept{move_constructible}} and + \tcode{\libconcept{assignable_from}}, \tcode{S} is an expression that exchanges the denoted values. \tcode{S} is a constant expression if \begin{itemize} @@ -643,17 +643,17 @@ \tcode{E1} and \tcode{E2} and has type \tcode{void}. \end{note} -\indexlibrary{\idxcode{Swappable}}% +\indexlibrary{\idxcode{swappable}}% \begin{itemdecl} template - concept Swappable = requires(T& a, T& b) { ranges::swap(a, b); }; + concept swappable = requires(T& a, T& b) { ranges::swap(a, b); }; \end{itemdecl} -\indexlibrary{\idxcode{SwappableWith}}% +\indexlibrary{\idxcode{swappable_with}}% \begin{itemdecl} template - concept SwappableWith = - CommonReference&, const remove_reference_t&> && + concept swappable_with = + common_reference_with&, const remove_reference_t&> && requires(T&& t, U&& u) { ranges::swap(std::forward(t), std::forward(t)); ranges::swap(std::forward(u), std::forward(u)); @@ -664,7 +664,7 @@ \pnum \begin{note} -The semantics of the \libconcept{Swappable} and \libconcept{SwappableWith} +The semantics of the \libconcept{swappable} and \libconcept{swappable_with} concepts are fully defined by the \tcode{ranges::swap} customization point. \end{note} @@ -679,12 +679,12 @@ namespace ranges = std::ranges; -template U> +template U> void value_swap(T&& t, U&& u) { ranges::swap(std::forward(t), std::forward(u)); } -template +template void lv_swap(T& t1, T& t2) { ranges::swap(t1, t2); } @@ -712,17 +712,17 @@ \end{codeblock} \end{example} -\rSec2[concept.destructible]{Concept \libconcept{Destructible}} +\rSec2[concept.destructible]{Concept \libconcept{destructible}} \pnum -The \libconcept{Destructible} concept specifies properties of all types, +The \libconcept{destructible} concept specifies properties of all types, instances of which can be destroyed at the end of their lifetime, or reference types. -\indexlibrary{\idxcode{Destructible}}% +\indexlibrary{\idxcode{destructible}}% \begin{itemdecl} template - concept Destructible = is_nothrow_destructible_v; + concept destructible = is_nothrow_destructible_v; \end{itemdecl} \begin{itemdescr} @@ -734,39 +734,39 @@ \end{note} \end{itemdescr} -\rSec2[concept.constructible]{Concept \libconcept{Constructible}} +\rSec2[concept.constructible]{Concept \libconcept{constructible_from}} \pnum -The \libconcept{Constructible} concept constrains the initialization of a +The \libconcept{constructible_from} concept constrains the initialization of a variable of a given type with a particular set of argument types. -\indexlibrary{\idxcode{Constructible}}% +\indexlibrary{\idxcode{constructible_from}}% \begin{itemdecl} template - concept Constructible = Destructible && is_constructible_v; + concept constructible_from = destructible && is_constructible_v; \end{itemdecl} -\rSec2[concept.defaultconstructible]{Concept \libconcept{DefaultConstructible}} +\rSec2[concept.defaultconstructible]{Concept \libconcept{default_constructible}} -\indexlibrary{\idxcode{DefaultConstructible}}% +\indexlibrary{\idxcode{default_constructible}}% \begin{itemdecl} template - concept DefaultConstructible = Constructible; + concept default_constructible = constructible_from; \end{itemdecl} -\rSec2[concept.moveconstructible]{Concept \libconcept{MoveConstructible}} +\rSec2[concept.moveconstructible]{Concept \libconcept{move_constructible}} -\indexlibrary{\idxcode{MoveConstructible}}% +\indexlibrary{\idxcode{move_constructible}}% \begin{itemdecl} template - concept MoveConstructible = Constructible && ConvertibleTo; + concept move_constructible = constructible_from && convertible_to; \end{itemdecl} \begin{itemdescr} \pnum If \tcode{T} is an object type, then let \tcode{rv} be an rvalue of type \tcode{T} and \tcode{u2} a distinct object of type \tcode{T} equal to -\tcode{rv}. \tcode{T} models \libconcept{MoveConstructible} only if +\tcode{rv}. \tcode{T} models \libconcept{move_constructible} only if \begin{itemize} \item After the definition \tcode{T u = rv;}, \tcode{u} is equal to \tcode{u2}. @@ -778,23 +778,23 @@ \end{itemize} \end{itemdescr} -\rSec2[concept.copyconstructible]{Concept \libconcept{CopyConstructible}} +\rSec2[concept.copyconstructible]{Concept \libconcept{copy_constructible}} -\indexlibrary{\idxcode{CopyConstructible}}% +\indexlibrary{\idxcode{copy_constructible}}% \begin{itemdecl} template - concept CopyConstructible = - MoveConstructible && - Constructible && ConvertibleTo && - Constructible && ConvertibleTo && - Constructible && ConvertibleTo; + concept copy_constructible = + move_constructible && + constructible_from && convertible_to && + constructible_from && convertible_to && + constructible_from && convertible_to; \end{itemdecl} \begin{itemdescr} \pnum If \tcode{T} is an object type, then let \tcode{v} be an lvalue of type (possibly \tcode{const}) \tcode{T} or an rvalue of type \tcode{const T}. -\tcode{T} models \libconcept{CopyConstructible} only if +\tcode{T} models \libconcept{copy_constructible} only if \begin{itemize} \item After the definition \tcode{T u = v;}, \tcode{u} is equal to \tcode{v}. @@ -812,40 +812,40 @@ This subclause describes concepts that establish relationships and orderings on values of possibly differing object types. -\rSec2[concept.boolean]{Concept \libconcept{Boolean}} +\rSec2[concept.boolean]{Concept \libconcept{boolean}} \pnum -The \libconcept{Boolean} concept specifies the requirements on a type that is +The \libconcept{boolean} concept specifies the requirements on a type that is usable in Boolean contexts. -\indexlibrary{\idxcode{Boolean}}% +\indexlibrary{\idxcode{boolean}}% \begin{itemdecl} template - concept Boolean = - Movable> && // (see \ref{concepts.object}) + concept boolean = + movable> && // (see \ref{concepts.object}) requires(const remove_reference_t& b1, const remove_reference_t& b2, const bool a) { - { b1 } -> ConvertibleTo; - { !b1 } -> ConvertibleTo; - { b1 && b2 } -> Same; - { b1 && a } -> Same; - { a && b2 } -> Same; - { b1 || b2 } -> Same; - { b1 || a } -> Same; - { a || b2 } -> Same; - { b1 == b2 } -> ConvertibleTo; - { b1 == a } -> ConvertibleTo; - { a == b2 } -> ConvertibleTo; - { b1 != b2 } -> ConvertibleTo; - { b1 != a } -> ConvertibleTo; - { a != b2 } -> ConvertibleTo; + { b1 } -> convertible_to; + { !b1 } -> convertible_to; + { b1 && b2 } -> same_as; + { b1 && a } -> same_as; + { a && b2 } -> same_as; + { b1 || b2 } -> same_as; + { b1 || a } -> same_as; + { a || b2 } -> same_as; + { b1 == b2 } -> convertible_to; + { b1 == a } -> convertible_to; + { a == b2 } -> convertible_to; + { b1 != b2 } -> convertible_to; + { b1 != a } -> convertible_to; + { a != b2 } -> convertible_to; }; \end{itemdecl} \pnum For some type \tcode{B}, let \tcode{b1} and \tcode{b2} be lvalues of type \tcode{const remove_reference_t}. -\tcode{B} models \libconcept{Boolean} only if +\tcode{B} models \libconcept{boolean} only if \begin{itemize} \item \tcode{bool(b1) == !bool(!b1)}. @@ -868,22 +868,22 @@ \pnum \begin{example} The types \tcode{bool}, \tcode{true_type}\iref{meta.type.synop}, and -\tcode{bitset<$N$>::reference}\iref{template.bitset} are \libconcept{Boolean} +\tcode{bitset<$N$>::reference}\iref{template.bitset} are \libconcept{boolean} types. Pointers, smart pointers, and types with only explicit conversions to -\tcode{bool} are not \libconcept{Boolean} types. +\tcode{bool} are not \libconcept{boolean} types. \end{example} -\rSec2[concept.equalitycomparable]{Concept \libconcept{EqualityComparable}} +\rSec2[concept.equalitycomparable]{Concept \libconcept{equality_comparable}} \begin{itemdecl} template concept @\placeholder{weakly-equality-comparable-with}@ = // \expos requires(const remove_reference_t& t, const remove_reference_t& u) { - { t == u } -> Boolean; - { t != u } -> Boolean; - { u == t } -> Boolean; - { u != t } -> Boolean; + { t == u } -> boolean; + { t != u } -> boolean; + { u == t } -> boolean; + { u != t } -> boolean; }; \end{itemdecl} @@ -904,16 +904,16 @@ \end{itemize} \end{itemdescr} -\indexlibrary{\idxcode{EqualityComparable}}% +\indexlibrary{\idxcode{equality_comparable}}% \begin{itemdecl} template - concept EqualityComparable = @\placeholder{weakly-equality-comparable-with}@; + concept equality_comparable = @\placeholder{weakly-equality-comparable-with}@; \end{itemdecl} \begin{itemdescr} \pnum Let \tcode{a} and \tcode{b} be objects of type \tcode{T}. -\tcode{T} models \libconcept{EqualityComparable} only if +\tcode{T} models \libconcept{equality_comparable} only if \tcode{bool(a == b)} is \tcode{true} when \tcode{a} is equal to \tcode{b}\iref{concepts.equality}, and \tcode{false} otherwise. @@ -924,13 +924,13 @@ \end{note} \end{itemdescr} -\indexlibrary{\idxcode{EqualityComparableWith}}% +\indexlibrary{\idxcode{equality_comparable_with}}% \begin{itemdecl} template - concept EqualityComparableWith = - EqualityComparable && EqualityComparable && - CommonReference&, const remove_reference_t&> && - EqualityComparable< + concept equality_comparable_with = + equality_comparable && equality_comparable && + common_reference_with&, const remove_reference_t&> && + equality_comparable< common_reference_t< const remove_reference_t&, const remove_reference_t&>> && @@ -947,23 +947,23 @@ common_reference_t&, const remove_reference_t&> \end{codeblock} \tcode{T} and \tcode{U} model -\tcode{\libconcept{EqualityComparableWith}} only if +\tcode{\libconcept{equality_comparable_with}} only if \tcode{bool(t == u) == bool(C(t) == C(u))}. \end{itemdescr} -\rSec2[concept.stricttotallyordered]{Concept \libconcept{StrictTotallyOrdered}} +\rSec2[concept.totallyordered]{Concept \libconcept{totally_ordered}} -\indexlibrary{\idxcode{StrictTotallyOrdered}}% +\indexlibrary{\idxcode{totally_ordered}}% \begin{itemdecl} template - concept StrictTotallyOrdered = - EqualityComparable && + concept totally_ordered = + equality_comparable && requires(const remove_reference_t& a, const remove_reference_t& b) { - { a < b } -> Boolean; - { a > b } -> Boolean; - { a <= b } -> Boolean; - { a >= b } -> Boolean; + { a < b } -> boolean; + { a > b } -> boolean; + { a <= b } -> boolean; + { a >= b } -> boolean; }; \end{itemdecl} @@ -971,7 +971,7 @@ \pnum For some type \tcode{T}, let \tcode{a}, \tcode{b}, and \tcode{c} be lvalues of type \tcode{const remove_reference_t}. -\tcode{T} models \libconcept{StrictTotallyOrdered} only if +\tcode{T} models \libconcept{totally_ordered} only if \begin{itemize} \item Exactly one of \tcode{bool(a < b)}, \tcode{bool(a > b)}, or @@ -987,24 +987,24 @@ \begin{itemdecl} template - concept StrictTotallyOrderedWith = - StrictTotallyOrdered && StrictTotallyOrdered && - CommonReference&, const remove_reference_t&> && - StrictTotallyOrdered< + concept totally_ordered_with = + totally_ordered && totally_ordered && + common_reference_with&, const remove_reference_t&> && + totally_ordered< common_reference_t< const remove_reference_t&, const remove_reference_t&>> && - EqualityComparableWith && + equality_comparable_with && requires(const remove_reference_t& t, const remove_reference_t& u) { - { t < u } -> Boolean; - { t > u } -> Boolean; - { t <= u } -> Boolean; - { t >= u } -> Boolean; - { u < t } -> Boolean; - { u > t } -> Boolean; - { u <= t } -> Boolean; - { u >= t } -> Boolean; + { t < u } -> boolean; + { t > u } -> boolean; + { t <= u } -> boolean; + { t >= u } -> boolean; + { u < t } -> boolean; + { u > t } -> boolean; + { u <= t } -> boolean; + { u >= t } -> boolean; }; \end{itemdecl} @@ -1018,7 +1018,7 @@ common_reference_t&, const remove_reference_t&> \end{codeblock} \tcode{T} and \tcode{U} model -\tcode{\libconcept{StrictTotallyOrderedWith}} only if +\tcode{\libconcept{totally_ordered_with}} only if \begin{itemize} \item \tcode{bool(t < u) == bool(C(t) < C(u)).} @@ -1038,32 +1038,33 @@ This subclause describes concepts that specify the basis of the value-oriented programming style on which the library is based. -\indexlibrary{\idxcode{Movable}}% -\indexlibrary{\idxcode{Copyable}}% -\indexlibrary{\idxcode{Semiregular}}% -\indexlibrary{\idxcode{Regular}}% +\indexlibrary{\idxcode{movable}}% +\indexlibrary{\idxcode{copyable}}% +\indexlibrary{\idxcode{semiregular}}% +\indexlibrary{\idxcode{regular}}% \begin{itemdecl} template - concept Movable = is_object_v && MoveConstructible && Assignable && Swappable; + concept movable = is_object_v && move_constructible && + assignable_from && swappable; template - concept Copyable = CopyConstructible && Movable && Assignable; + concept copyable = copy_constructible && movable && assignable_from; template - concept Semiregular = Copyable && DefaultConstructible; + concept semiregular = copyable && default_constructible; template - concept Regular = Semiregular && EqualityComparable; + concept regular = semiregular && equality_comparable; \end{itemdecl} \begin{itemdescr} \pnum \begin{note} -The \libconcept{Semiregular} concept is modeled by types that behave similarly +The \libconcept{semiregular} concept is modeled by types that behave similarly to built-in types like \tcode{int}, except that they might not be comparable with \tcode{==}. \end{note} \pnum \begin{note} -The \libconcept{Regular} concept is modeled by types that behave similarly to +The \libconcept{regular} concept is modeled by types that behave similarly to built-in types like \tcode{int} and that are comparable with \tcode{==}. \end{note} @@ -1077,17 +1078,17 @@ The concepts in this subclause describe the requirements on function objects\iref{function.objects} and their arguments. -\rSec2[concept.invocable]{Concept \libconcept{Invocable}} +\rSec2[concept.invocable]{Concept \libconcept{invocable}} \pnum -The \libconcept{Invocable} concept specifies a relationship between a callable +The \libconcept{invocable} concept specifies a relationship between a callable type\iref{func.def} \tcode{F} and a set of argument types \tcode{Args...} which can be evaluated by the library function \tcode{invoke}\iref{func.invoke}. -\indexlibrary{\idxcode{Invocable}}% +\indexlibrary{\idxcode{invocable}}% \begin{itemdecl} template - concept Invocable = requires(F&& f, Args&&... args) { + concept invocable = requires(F&& f, Args&&... args) { invoke(std::forward(f), std::forward(args)...); // not required to be equality-preserving }; \end{itemdecl} @@ -1095,18 +1096,18 @@ \begin{itemdescr} \pnum \begin{example} -A function that generates random numbers can model \libconcept{Invocable}, +A function that generates random numbers can model \libconcept{invocable}, since the \tcode{invoke} function call expression is not required to be equality-preserving\iref{concepts.equality}. \end{example} \end{itemdescr} -\rSec2[concept.regularinvocable]{Concept \libconcept{RegularInvocable}} +\rSec2[concept.regularinvocable]{Concept \libconcept{regular_invocable}} -\indexlibrary{\idxcode{RegularInvocable}}% +\indexlibrary{\idxcode{regular_invocable}}% \begin{itemdecl} template - concept RegularInvocable = Invocable; + concept regular_invocable = invocable; \end{itemdecl} \begin{itemdescr} @@ -1116,50 +1117,50 @@ arguments\iref{concepts.equality}. \begin{note} This requirement supersedes the annotation in the definition of -\libconcept{Invocable}. +\libconcept{invocable}. \end{note} \pnum \begin{example} -A random number generator does not model \libconcept{RegularInvocable}. +A random number generator does not model \libconcept{regular_invocable}. \end{example} \pnum \begin{note} -The distinction between \libconcept{Invocable} and \libconcept{RegularInvocable} +The distinction between \libconcept{invocable} and \libconcept{regular_invocable} is purely semantic. \end{note} \end{itemdescr} -\rSec2[concept.predicate]{Concept \libconcept{Predicate}} +\rSec2[concept.predicate]{Concept \libconcept{predicate}} -\indexlibrary{\idxcode{Predicate}}% +\indexlibrary{\idxcode{predicate}}% \begin{itemdecl} template - concept Predicate = RegularInvocable && Boolean>; + concept predicate = regular_invocable && boolean>; \end{itemdecl} -\rSec2[concept.relation]{Concept \libconcept{Relation}} +\rSec2[concept.relation]{Concept \libconcept{relation}} -\indexlibrary{\idxcode{Relation}}% +\indexlibrary{\idxcode{relation}}% \begin{itemdecl} template - concept Relation = - Predicate && Predicate && - Predicate && Predicate; + concept relation = + predicate && predicate && + predicate && predicate; \end{itemdecl} -\rSec2[concept.strictweakorder]{Concept \libconcept{StrictWeakOrder}} +\rSec2[concept.strictweakorder]{Concept \libconcept{strict_weak_order}} -\indexlibrary{\idxcode{Relation}}% +\indexlibrary{\idxcode{strict_weak_order}}% \begin{itemdecl} template - concept StrictWeakOrder = Relation; + concept strict_weak_order = relation; \end{itemdecl} \begin{itemdescr} \pnum -A \libconcept{Relation} models \libconcept{StrictWeakOrder} only if +A \libconcept{relation} models \libconcept{strict_weak_order} only if it imposes a \term{strict weak ordering} on its arguments. \pnum diff --git a/source/containers.tex b/source/containers.tex index 085159a376..24b4216aaf 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -465,7 +465,7 @@ whose member types \tcode{iterator} and \tcode{const_iterator} meet the \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators} and -model \libconcept{ContiguousIterator}\iref{iterator.concept.contiguous}. +model \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous}. \pnum \tref{container.opt} lists operations that are provided @@ -9398,7 +9398,7 @@ bool operator<=(const queue& x, const queue& y); template bool operator>=(const queue& x, const queue& y); - template + template compare_three_way_result_t operator<=>(const queue& x, const queue& y); @@ -9440,7 +9440,7 @@ bool operator<=(const stack& x, const stack& y); template bool operator>=(const stack& x, const stack& y); - template + template compare_three_way_result_t operator<=>(const stack& x, const stack& y); @@ -9678,7 +9678,7 @@ \indexlibrary{\idxcode{operator<=>}!\idxcode{queue}}% \begin{itemdecl} -template +template compare_three_way_result_t operator<=>(const queue& x, const queue& y); \end{itemdecl} @@ -10238,7 +10238,7 @@ \indexlibrary{\idxcode{operator<=>}!\idxcode{stack}}% \begin{itemdecl} -template +template compare_three_way_result_t operator<=>(const stack& x, const stack& y); \end{itemdecl} @@ -10814,7 +10814,7 @@ \begin{itemdescr} \pnum The types -model \libconcept{ContiguousIterator}\iref{iterator.concept.contiguous}, +model \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous}, meet the \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators}, and diff --git a/source/expressions.tex b/source/expressions.tex index 93dc47ff56..1c622c727e 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -2505,7 +2505,7 @@ template concept R = requires (T i) { typename T::type; - {*i} -> ConvertibleTo; + {*i} -> convertible_to; }; \end{codeblock} A \grammarterm{requires-expression} can also be used in a @@ -2710,14 +2710,14 @@ \begin{codeblock} template concept C2 = requires(T x) { - {*x} -> Same; + {*x} -> same_as; }; \end{codeblock} The \grammarterm{compound-requirement} in \tcode{C2} requires that \tcode{*x} is a valid expression, that \tcode{typename T::inner} is a valid type, and -that \tcode{Same} is satisfied. +that \tcode{same_as} is satisfied. \begin{codeblock} template concept C3 = @@ -4934,7 +4934,7 @@ \begin{example} \begin{codeblock} - void mergeable(int x) { + void can_merge(int x) { // These allocations are safe for merging: std::unique_ptr a{new (std::nothrow) char[8]}; std::unique_ptr b{new (std::nothrow) char[8]}; @@ -4943,7 +4943,7 @@ g(a.get(), b.get(), c.get()); } - void unmergeable(int x) { + void cannot_merge(int x) { std::unique_ptr a{new char[8]}; try { // Merging this allocation would change its catch handler. diff --git a/source/iterators.tex b/source/iterators.tex index 4643722faa..9e95e92656 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -81,128 +81,128 @@ = decltype(ranges::iter_move(declval())); // \ref{iterator.concepts}, iterator concepts - // \ref{iterator.concept.readable}, concept \tcode{Readable} + // \ref{iterator.concept.readable}, concept \libconcept{readable} template - concept Readable = @\seebelow@; + concept readable = @\seebelow@; - template + template using iter_common_reference_t = common_reference_t, iter_value_t&>; - // \ref{iterator.concept.writable}, concept \tcode{Writable} + // \ref{iterator.concept.writable}, concept \libconcept{writable} template - concept Writable = @\seebelow@; + concept writable = @\seebelow@; - // \ref{iterator.concept.winc}, concept \tcode{WeaklyIncrementable} + // \ref{iterator.concept.winc}, concept \libconcept{weakly_incrementable} template - concept WeaklyIncrementable = @\seebelow@; + concept weakly_incrementable = @\seebelow@; - // \ref{iterator.concept.inc}, concept \tcode{Incrementable} + // \ref{iterator.concept.inc}, concept \libconcept{incrementable} template - concept Incrementable = @\seebelow@; + concept incrementable = @\seebelow@; - // \ref{iterator.concept.iterator}, concept \tcode{Iterator} + // \ref{iterator.concept.iterator}, concept \libconcept{input_or_output_iterator} template - concept Iterator = @\seebelow@; + concept input_or_output_iterator = @\seebelow@; - // \ref{iterator.concept.sentinel}, concept \tcode{Sentinel} + // \ref{iterator.concept.sentinel}, concept \libconcept{sentinel_for} template - concept Sentinel = @\seebelow@; + concept sentinel_for = @\seebelow@; - // \ref{iterator.concept.sizedsentinel}, concept \tcode{SizedSentinel} + // \ref{iterator.concept.sizedsentinel}, concept \libconcept{sized_sentinel_for} template inline constexpr bool disable_sized_sentinel = false; template - concept SizedSentinel = @\seebelow@; + concept sized_sentinel_for = @\seebelow@; - // \ref{iterator.concept.input}, concept \tcode{InputIterator} + // \ref{iterator.concept.input}, concept \libconcept{input_iterator} template - concept InputIterator = @\seebelow@; + concept input_iterator = @\seebelow@; - // \ref{iterator.concept.output}, concept \tcode{OutputIterator} + // \ref{iterator.concept.output}, concept \libconcept{output_iterator} template - concept OutputIterator = @\seebelow@; + concept output_iterator = @\seebelow@; - // \ref{iterator.concept.forward}, concept \tcode{ForwardIterator} + // \ref{iterator.concept.forward}, concept \libconcept{forward_iterator} template - concept ForwardIterator = @\seebelow@; + concept forward_iterator = @\seebelow@; - // \ref{iterator.concept.bidir}, concept \tcode{BidirectionalIterator} + // \ref{iterator.concept.bidir}, concept \libconcept{bidirectional_iterator} template - concept BidirectionalIterator = @\seebelow@; + concept bidirectional_iterator = @\seebelow@; - // \ref{iterator.concept.random.access}, concept \tcode{RandomAccessIterator} + // \ref{iterator.concept.random.access}, concept \libconcept{random_access_iterator} template - concept RandomAccessIterator = @\seebelow@; + concept random_access_iterator = @\seebelow@; - // \ref{iterator.concept.contiguous}, concept \tcode{ContiguousIterator} + // \ref{iterator.concept.contiguous}, concept \libconcept{contiguous_iterator} template - concept ContiguousIterator = @\seebelow@; + concept contiguous_iterator = @\seebelow@; // \ref{indirectcallable}, indirect callable requirements // \ref{indirectcallable.indirectinvocable}, indirect callables template - concept IndirectUnaryInvocable = @\seebelow@; + concept indirectly_unary_invocable = @\seebelow@; template - concept IndirectRegularUnaryInvocable = @\seebelow@; + concept indirectly_regular_unary_invocable = @\seebelow@; template - concept IndirectUnaryPredicate = @\seebelow@; + concept indirect_unary_predicate = @\seebelow@; template - concept IndirectRelation = @\seebelow@; + concept indirect_relation = @\seebelow@; template - concept IndirectStrictWeakOrder = @\seebelow@; + concept indirect_strict_weak_order = @\seebelow@; template - requires (Readable && ...) && Invocable...> + requires (readable && ...) && invocable...> using indirect_result_t = invoke_result_t...>; // \ref{projected}, projected - template Proj> + template Proj> struct projected; - template + template struct incrementable_traits>; // \ref{alg.req}, common algorithm requirements - // \ref{alg.req.ind.move}, concept \tcode{IndirectlyMovable} + // \ref{alg.req.ind.move}, concept \libconcept{indirectly_movable} template - concept IndirectlyMovable = @\seebelow@; + concept indirectly_movable = @\seebelow@; template - concept IndirectlyMovableStorable = @\seebelow@; + concept indirectly_movable_storable = @\seebelow@; - // \ref{alg.req.ind.copy}, concept \tcode{IndirectlyCopyable} + // \ref{alg.req.ind.copy}, concept \libconcept{indirectly_copyable} template - concept IndirectlyCopyable = @\seebelow@; + concept indirectly_copyable = @\seebelow@; template - concept IndirectlyCopyableStorable = @\seebelow@; + concept indirectly_copyable_storable = @\seebelow@; - // \ref{alg.req.ind.swap}, concept \tcode{IndirectlySwappable} + // \ref{alg.req.ind.swap}, concept \libconcept{indirectly_swappable} template - concept IndirectlySwappable = @\seebelow@; + concept indirectly_swappable = @\seebelow@; - // \ref{alg.req.ind.cmp}, concept \tcode{IndirectlyComparable} + // \ref{alg.req.ind.cmp}, concept \libconcept{indirectly_comparable} template - concept IndirectlyComparable = @\seebelow@; + concept indirectly_comparable = @\seebelow@; - // \ref{alg.req.permutable}, concept \tcode{Permutable} + // \ref{alg.req.permutable}, concept \libconcept{permutable} template - concept Permutable = @\seebelow@; + concept permutable = @\seebelow@; - // \ref{alg.req.mergeable}, concept \tcode{Mergeable} + // \ref{alg.req.mergeable}, concept \libconcept{mergeable} template - concept Mergeable = @\seebelow@; + concept mergeable = @\seebelow@; - // \ref{alg.req.sortable}, concept \tcode{Sortable} + // \ref{alg.req.sortable}, concept \libconcept{sortable} template - concept Sortable = @\seebelow@; + concept sortable = @\seebelow@; // \ref{iterator.primitives}, primitives // \ref{std.iterator.tags}, iterator tags @@ -232,35 +232,35 @@ // \ref{range.iter.ops}, range iterator operations namespace ranges { // \ref{range.iter.op.advance}, \tcode{ranges::advance} - template + template constexpr void advance(I& i, iter_difference_t n); - template S> + template S> constexpr void advance(I& i, S bound); - template S> + template S> constexpr iter_difference_t advance(I& i, iter_difference_t n, S bound); // \ref{range.iter.op.distance}, \tcode{ranges::distance} - template S> + template S> constexpr iter_difference_t distance(I first, S last); - template + template constexpr range_difference_t distance(R&& r); // \ref{range.iter.op.next}, \tcode{ranges::next} - template + template constexpr I next(I x); - template + template constexpr I next(I x, iter_difference_t n); - template S> + template S> constexpr I next(I x, S bound); - template S> + template S> constexpr I next(I x, iter_difference_t n, S bound); // \ref{range.iter.op.prev}, \tcode{ranges::prev} - template + template constexpr I prev(I x); - template + template constexpr I prev(I x, iter_difference_t n); - template + template constexpr I prev(I x, iter_difference_t n, I bound); } @@ -292,7 +292,7 @@ constexpr bool operator>=( const reverse_iterator& x, const reverse_iterator& y); - template Iterator2> + template Iterator2> constexpr compare_three_way_result_t operator<=>(const reverse_iterator& x, const reverse_iterator& y); @@ -311,7 +311,7 @@ constexpr reverse_iterator make_reverse_iterator(Iterator i); template - requires (!SizedSentinel) + requires (!sized_sentinel_for) inline constexpr bool disable_sized_sentinel, reverse_iterator> = true; @@ -347,7 +347,7 @@ template constexpr bool operator>=( const move_iterator& x, const move_iterator& y); - template Iterator2> + template Iterator2> constexpr compare_three_way_result_t operator<=>(const move_iterator& x, const move_iterator& y); @@ -363,17 +363,17 @@ template constexpr move_iterator make_move_iterator(Iterator i); - template class move_sentinel; + template class move_sentinel; // \ref{iterators.common}, common iterators - template S> - requires (!Same) + template S> + requires (!same_as) class common_iterator; template struct incrementable_traits>; - template + template struct iterator_traits>; // \ref{default.sentinels}, default sentinels @@ -381,12 +381,12 @@ inline constexpr default_sentinel_t default_sentinel{}; // \ref{iterators.counted}, counted iterators - template class counted_iterator; + template class counted_iterator; template struct incrementable_traits>; - template + template struct iterator_traits>; // \ref{unreachable.sentinels}, unreachable sentinels @@ -513,16 +513,18 @@ \pnum The six categories of iterators correspond to the iterator concepts -\libconcept{Input\-Iterator}\iref{iterator.concept.input}, -\libconcept{Output\-Iterator}\iref{iterator.concept.output}, -\libconcept{Forward\-Iterator}\iref{iterator.concept.forward}, -\libconcept{Bidirectional\-Iterator}\iref{iterator.concept.bidir} -\libconcept{RandomAccess\-Iterator}\iref{iterator.concept.random.access}, +\begin{itemize} +\item \libconcept{input_iterator}\iref{iterator.concept.input}, +\item \libconcept{output_iterator}\iref{iterator.concept.output}, +\item \libconcept{forward_iterator}\iref{iterator.concept.forward}, +\item \libconcept{bidirectional_iterator}\iref{iterator.concept.bidir} +\item \libconcept{random_access_iterator}\iref{iterator.concept.random.access}, and -\libconcept{Contiguous\-Iterator}\iref{iterator.concept.contiguous}, +\item \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous}, +\end{itemize} respectively. The generic term \defn{iterator} refers to any type that models the -\libconcept{Iterator} concept\iref{iterator.concept.iterator}. +\libconcept{input_or_output_iterator} concept\iref{iterator.concept.iterator}. \pnum Forward iterators meet all the requirements of input @@ -668,7 +670,7 @@ it is often necessary to determine the difference type that corresponds to a particular incrementable type. Accordingly, it is required that if \tcode{WI} is the name of a type that models the -\tcode{WeaklyIncrementable} concept\iref{iterator.concept.winc}, +\libconcept{weakly_incrementable} concept\iref{iterator.concept.winc}, the type \begin{codeblock} iter_difference_t @@ -698,7 +700,7 @@ template requires (!requires { typename T::difference_type; } && - requires(const T& a, const T& b) { { a - b } -> Integral; }) + requires(const T& a, const T& b) { { a - b } -> integral; }) struct incrementable_traits { using difference_type = make_signed_t() - declval())>; }; @@ -730,7 +732,7 @@ To implement algorithms only in terms of readable types, it is often necessary to determine the value type that corresponds to a particular readable type. Accordingly, it is required that if \tcode{R} is the name of a type that -models the \tcode{Readable} concept\iref{iterator.concept.readable}, +models the \libconcept{readable} concept\iref{iterator.concept.readable}, the type \begin{codeblock} iter_value_t @@ -795,15 +797,15 @@ \pnum \begin{note} Some legacy output iterators define a nested type named \tcode{value_type} -that is an alias for \tcode{void}. These types are not \tcode{Readable} +that is an alias for \tcode{void}. These types are not \tcode{readable} and have no associated value types. \end{note} \pnum \begin{note} -Smart pointers like \tcode{shared_ptr} are \tcode{Readable} and +Smart pointers like \tcode{shared_ptr} are \tcode{readable} and have an associated value type, but a smart pointer like \tcode{shared_ptr} -is not \tcode{Readable} and has no associated value type. +is not \tcode{readable} and has no associated value type. \end{note} \rSec3[iterator.traits]{Iterator traits} @@ -855,53 +857,53 @@ \begin{codeblock} template concept @\placeholder{cpp17-iterator}@ = - Copyable && requires(I i) { + copyable && requires(I i) { { *i } -> @\placeholder{can-reference}@; - { ++i } -> Same; + { ++i } -> same_as; { *i++ } -> @\placeholder{can-reference}@; }; template concept @\placeholder{cpp17-input-iterator}@ = - @\placeholder{cpp17-iterator}@ && EqualityComparable && requires(I i) { + @\placeholder{cpp17-iterator}@ && equality_comparable && requires(I i) { typename incrementable_traits::difference_type; typename readable_traits::value_type; typename common_reference_t&&, typename readable_traits::value_type&>; typename common_reference_t::value_type&>; - requires SignedIntegral::difference_type>; + requires signed_integral::difference_type>; }; template concept @\placeholder{cpp17-forward-iterator}@ = - @\placeholder{cpp17-input-iterator}@ && Constructible && + @\placeholder{cpp17-input-iterator}@ && constructible_from && is_lvalue_reference_v> && - Same>, typename readable_traits::value_type> && + same_as>, typename readable_traits::value_type> && requires(I i) { - { i++ } -> ConvertibleTo; - { *i++ } -> Same>; + { i++ } -> convertible_to; + { *i++ } -> same_as>; }; template concept @\placeholder{cpp17-bidirectional-iterator}@ = @\placeholder{cpp17-forward-iterator}@ && requires(I i) { - { --i } -> Same; - { i-- } -> ConvertibleTo; - { *i-- } -> Same>; + { --i } -> same_as; + { i-- } -> convertible_to; + { *i-- } -> same_as>; }; template concept @\placeholder{cpp17-random-access-iterator}@ = - @\placeholder{cpp17-bidirectional-iterator}@ && StrictTotallyOrdered && + @\placeholder{cpp17-bidirectional-iterator}@ && totally_ordered && requires(I i, typename incrementable_traits::difference_type n) { - { i += n } -> Same; - { i -= n } -> Same; - { i + n } -> Same; - { n + i } -> Same; - { i - n } -> Same; - { i - i } -> Same; - { i[n] } -> ConvertibleTo>; + { i += n } -> same_as; + { i -= n } -> same_as; + { i + n } -> same_as; + { n + i } -> same_as; + { i - n } -> same_as; + { i - i } -> same_as; + { i[n] } -> convertible_to>; }; \end{codeblock} @@ -1120,13 +1122,13 @@ ill-formed with no diagnostic required. \item Otherwise, if the types of \tcode{E1} and \tcode{E2} each model -\tcode{Readable}, and if the reference types of \tcode{E1} and \tcode{E2} -model \libconcept{SwappableWith}\iref{concept.swappable}, +\tcode{readable}, and if the reference types of \tcode{E1} and \tcode{E2} +model \libconcept{swappable_with}\iref{concept.swappable}, then \tcode{ranges::swap(*E1, *E2)}. \item Otherwise, if the types \tcode{T1} and \tcode{T2} of \tcode{E1} and -\tcode{E2} model \tcode{IndirectlyMovableStorable} and -\tcode{IndirectlyMovableStorable}, then +\tcode{E2} model \tcode{\libconcept{indirectly_movable_storable}} and +\tcode{indirectly_movable_storable}, then \tcode{(void)(*E1 = \placeholdernc{iter-exchange-move}(E2, E1))}, except that \tcode{E1} is evaluated only once. @@ -1187,45 +1189,45 @@ and \tcode{\placeholder{ITER_CONCEPT}(I)} denotes \tcode{random_access_iterator_tag}. \end{example} -\rSec3[iterator.concept.readable]{Concept \libconcept{Readable}} +\rSec3[iterator.concept.readable]{Concept \libconcept{readable}} \pnum Types that are readable by applying \tcode{operator*} -model the \libconcept{Readable} concept, including +model the \libconcept{readable} concept, including pointers, smart pointers, and iterators. -\indexlibrary{\idxcode{Readable}}% +\indexlibrary{\idxcode{readable}}% \begin{codeblock} template - concept Readable = + concept readable = requires { typename iter_value_t; typename iter_reference_t; typename iter_rvalue_reference_t; } && - CommonReference&&, iter_value_t&> && - CommonReference&&, iter_rvalue_reference_t&&> && - CommonReference&&, const iter_value_t&>; + common_reference_with&&, iter_value_t&> && + common_reference_with&&, iter_rvalue_reference_t&&> && + common_reference_with&&, const iter_value_t&>; \end{codeblock} \pnum -Given a value \tcode{i} of type \tcode{I}, \tcode{I} models \libconcept{Readable} +Given a value \tcode{i} of type \tcode{I}, \tcode{I} models \libconcept{readable} only if the expression \tcode{*i} is equality-preserving. \begin{note} The expression \tcode{*i} is indirectly required to be valid via the exposition-only \placeholder{dereferenceable} concept\iref{iterator.synopsis}. \end{note} -\rSec3[iterator.concept.writable]{Concept \tcode{Writable}} +\rSec3[iterator.concept.writable]{Concept \libconcept{writable}} \pnum -The \tcode{Writable} concept specifies the requirements for writing a value +The \libconcept{writable} concept specifies the requirements for writing a value into an iterator's referenced object. -\indexlibrary{\idxcode{Writable}}% +\indexlibrary{\idxcode{writable}}% \begin{codeblock} template - concept Writable = + concept writable = requires(Out&& o, T&& t) { *o = std::forward(t); // not required to be equality-preserving *std::forward(o) = std::forward(t); // not required to be equality-preserving @@ -1239,11 +1241,11 @@ \pnum Let \tcode{E} be an an expression such that \tcode{decltype((E))} is \tcode{T}, and let \tcode{o} be a dereferenceable object of type \tcode{Out}. -\tcode{Out} and \tcode{T} model \tcode{Writable} only if +\tcode{Out} and \tcode{T} model \tcode{\libconcept{writable}} only if \begin{itemize} \item If \tcode{Out} and \tcode{T} model - \tcode{Readable \&\& Same, decay_t{>}}, + \tcode{readable \&\& same_as, decay_t{>}}, then \tcode{*o} after any above assignment is equal to the value of \tcode{E} before the assignment. \end{itemize} @@ -1263,22 +1265,22 @@ \pnum \begin{note} -\tcode{Writable} has the awkward \tcode{const_cast} expressions to reject +\tcode{writable} has the awkward \tcode{const_cast} expressions to reject iterators with prvalue non-proxy reference types that permit rvalue assignment but do not also permit \tcode{const} rvalue assignment. Consequently, an iterator type \tcode{I} that returns \tcode{std::string} -by value does not model \libconcept{Writable}. +by value does not model \tcode{\libconcept{writable}}. \end{note} -\rSec3[iterator.concept.winc]{Concept \tcode{WeaklyIncrementable}} +\rSec3[iterator.concept.winc]{Concept \libconcept{weakly_incrementable}} \pnum -The \tcode{WeaklyIncrementable} concept specifies the requirements on +The \libconcept{weakly_incrementable} concept specifies the requirements on types that can be incremented with the pre- and post-increment operators. The increment operations are not required to be equality-preserving, -nor is the type required to be \libconcept{EqualityComparable}. +nor is the type required to be \libconcept{equality_comparable}. -\indexlibrary{\idxcode{WeaklyIncrementable}}% +\indexlibrary{\idxcode{weakly_incrementable}}% \begin{codeblock} template inline constexpr bool @\placeholder{is-integer-like}@ = @\seebelow@; @\itcorr[-2]@ // exposition only @@ -1287,12 +1289,12 @@ inline constexpr bool @\placeholder{is-signed-integer-like}@ = @\seebelow@; @\itcorr[-2]@ // exposition only template - concept WeaklyIncrementable = - DefaultConstructible && Movable && + concept weakly_incrementable = + default_constructible && movable && requires(I i) { typename iter_difference_t; requires @\placeholdernc{is-signed-integer-like}@>; - { ++i } -> Same; // not required to be equality-preserving + { ++i } -> same_as; // not required to be equality-preserving i++; // not required to be equality-preserving }; \end{codeblock} @@ -1356,8 +1358,8 @@ \pnum All integer-class types model -\libconcept{Regular}\iref{concepts.object} and -\libconcept{StrictTotallyOrdered}\iref{concept.stricttotallyordered}. +\libconcept{regular}\iref{concepts.object} and +\libconcept{totally_ordered}\iref{concept.totallyordered}. \pnum A value-initialized object of integer-class type has value 0. @@ -1387,11 +1389,11 @@ \pnum A type \tcode{I} is \defn{integer-like} -if it models \tcode{Integral} or if it is an integer-class type. +if it models \tcode{integral} or if it is an integer-class type. A type \tcode{I} is \defn{signed-integer-like} -if it models \tcode{SignedIntegral} or if it is a signed-integer-class type. +if it models \tcode{signed_integral} or if it is a signed-integer-class type. A type \tcode{I} is \defn{unsigned-integer-like} -if it models \tcode{UnsignedIntegral} or +if it models \tcode{unsigned_integral} or if it is an unsigned-integer-class type. \pnum @@ -1403,7 +1405,7 @@ \pnum Let \tcode{i} be an object of type \tcode{I}. When \tcode{i} is in the domain of both pre- and post-increment, \tcode{i} is said to be \term{incrementable}. -\tcode{I} models \tcode{WeaklyIncrementable} only if +\tcode{I} models \tcode{weakly_incrementable} only if \begin{itemize} \item The expressions \tcode{++i} and \tcode{i++} have the same domain. @@ -1416,7 +1418,7 @@ \pnum \begin{note} -For \tcode{WeaklyIncrementable} types, \tcode{a} equals \tcode{b} does not imply that \tcode{++a} +For \tcode{weakly_incrementable} types, \tcode{a} equals \tcode{b} does not imply that \tcode{++a} equals \tcode{++b}. (Equality does not guarantee the substitution property or referential transparency.) Algorithms on weakly incrementable types should never attempt to pass through the same incrementable value twice. They should be single-pass algorithms. These algorithms @@ -1424,31 +1426,31 @@ template. \end{note} -\rSec3[iterator.concept.inc]{Concept \tcode{Incrementable}} +\rSec3[iterator.concept.inc]{Concept \libconcept{incrementable}} \pnum -The \tcode{Incrementable} concept specifies requirements on types that can be incremented with the pre- +The \libconcept{incrementable} concept specifies requirements on types that can be incremented with the pre- and post-increment operators. The increment operations are required to be equality-preserving, -and the type is required to be \libconcept{EqualityComparable}. +and the type is required to be \libconcept{equality_comparable}. \begin{note} This supersedes the annotations on the increment expressions -in the definition of \tcode{WeaklyIncrementable}. +in the definition of \tcode{weakly_incrementable}. \end{note} -\indexlibrary{\idxcode{Incrementable}}% +\indexlibrary{\idxcode{incrementable}}% \begin{codeblock} template - concept Incrementable = - Regular && - WeaklyIncrementable && + concept incrementable = + regular && + weakly_incrementable && requires(I i) { - { i++ } -> Same; + { i++ } -> same_as; }; \end{codeblock} \pnum Let \tcode{a} and \tcode{b} be incrementable objects of type \tcode{I}. -\tcode{I} models \libconcept{Incrementable} only if +\tcode{I} models \libconcept{incrementable} only if \begin{itemize} \item If \tcode{bool(a == b)} then \tcode{bool(a++ == b)}. @@ -1463,14 +1465,14 @@ \tcode{++a} equals \tcode{++b} (which is not true for weakly incrementable types) allows the use of multi-pass one-directional -algorithms with types that model \libconcept{Increment\-able}. +algorithms with types that model \libconcept{incrementable}. \end{note} -\rSec3[iterator.concept.iterator]{Concept \tcode{Iterator}} +\rSec3[iterator.concept.iterator]{Concept \libconcept{input_or_output_iterator}} \pnum -The \libconcept{Iterator} concept forms the basis -of the iterator concept taxonomy; every iterator models \libconcept{Iterator}. +The \libconcept{input_or_output_iterator} concept forms the basis +of the iterator concept taxonomy; every iterator models \libconcept{input_or_output_iterator}. This concept specifies operations for dereferencing and incrementing an iterator. Most algorithms will require additional operations to compare iterators with sentinels\iref{iterator.concept.sentinel}, to @@ -1478,35 +1480,35 @@ to provide a richer set of iterator movements (\ref{iterator.concept.forward}, \ref{iterator.concept.bidir}, \ref{iterator.concept.random.access}). -\indexlibrary{\idxcode{Iterator}}% +\indexlibrary{\idxcode{input_or_output_iterator}}% \begin{codeblock} template - concept Iterator = + concept input_or_output_iterator = requires(I i) { { *i } -> @\placeholder{can-reference}@; } && - WeaklyIncrementable; + weakly_incrementable; \end{codeblock} \pnum \begin{note} Unlike the \oldconcept{Iterator} requirements, -the \libconcept{Iterator} concept does not require copyability. +the \libconcept{input_or_output_iterator} concept does not require copyability. \end{note} -\rSec3[iterator.concept.sentinel]{Concept \tcode{Sentinel}} +\rSec3[iterator.concept.sentinel]{Concept \libconcept{sentinel_for}} \pnum -The \libconcept{Sentinel} concept specifies the relationship -between an \libconcept{Iterator} type and a \libconcept{Semiregular} type +The \libconcept{sentinel_for} concept specifies the relationship +between an \libconcept{input_or_output_iterator} type and a \libconcept{semiregular} type whose values denote a range. -\indexlibrary{\idxcode{Sentinel}}% +\indexlibrary{\idxcode{sentinel_for}}% \begin{itemdecl} template - concept Sentinel = - Semiregular && - Iterator && + concept sentinel_for = + semiregular && + input_or_output_iterator && @\placeholder{weakly-equality-comparable-with}@; // See \ref{concept.equalitycomparable} \end{itemdecl} @@ -1514,7 +1516,7 @@ \pnum Let \tcode{s} and \tcode{i} be values of type \tcode{S} and \tcode{I} such that \range{i}{s} denotes a range. Types -\tcode{S} and \tcode{I} model \tcode{Sentinel} only if +\tcode{S} and \tcode{I} model \tcode{\libconcept{sentinel_for}} only if \begin{itemize} \item \tcode{i == s} is well-defined. @@ -1532,24 +1534,25 @@ to \tcode{i}. Consequently, \tcode{i == s} is no longer required to be well-defined. -\rSec3[iterator.concept.sizedsentinel]{Concept \tcode{SizedSentinel}} +\rSec3[iterator.concept.sizedsentinel]{Concept \libconcept{sized_sentinel_for}} \pnum -The \libconcept{SizedSentinel} concept specifies -requirements on an \libconcept{Iterator} and a \libconcept{Sentinel} +The \libconcept{sized_sentinel_for} concept specifies +requirements on an \libconcept{input_or_output_iterator} and +a corresponding \libconcept{sentinel_for} that allow the use of the \tcode{-} operator to compute the distance between them in constant time. -\indexlibrary{\idxcode{SizedSentinel}}% +\indexlibrary{\idxcode{sized_sentinel_for}}% \begin{itemdecl} template - concept SizedSentinel = - Sentinel && + concept sized_sentinel_for = + sentinel_for && !disable_sized_sentinel, remove_cv_t> && requires(const I& i, const S& s) { - { s - i } -> Same>; - { i - s } -> Same>; + { s - i } -> same_as>; + { i - s } -> same_as>; }; \end{itemdecl} @@ -1559,7 +1562,7 @@ a sentinel of type \tcode{S} such that \range{i}{s} denotes a range. Let $N$ be the smallest number of applications of \tcode{++i} necessary to make \tcode{bool(i == s)} be \tcode{true}. -\tcode{S} and \tcode{I} model \tcode{SizedSentinel} only if +\tcode{S} and \tcode{I} model \tcode{\libconcept{sized_sentinel_for}} only if \begin{itemize} \item If $N$ is representable by \tcode{iter_difference_t}, @@ -1590,56 +1593,56 @@ \pnum \begin{note} \tcode{disable_sized_sentinel} allows use of sentinels and iterators with -the library that satisfy but do not in fact model \libconcept{SizedSentinel}. +the library that satisfy but do not in fact model \libconcept{sized_sentinel_for}. \end{note} \pnum \begin{example} -The \libconcept{SizedSentinel} concept is modeled by pairs of -\libconcept{RandomAccessIterator}s\iref{iterator.concept.random.access} and by +The \libconcept{sized_sentinel_for} concept is modeled by pairs of +\libconcept{random_access_iterator}s\iref{iterator.concept.random.access} and by counted iterators and their sentinels\iref{counted.iterator}. \end{example} \end{itemdescr} -\rSec3[iterator.concept.input]{Concept \tcode{InputIterator}} +\rSec3[iterator.concept.input]{Concept \libconcept{input_iterator}} \pnum -The \tcode{InputIterator} concept defines requirements for a type +The \libconcept{input_iterator} concept defines requirements for a type whose referenced values can be read (from the requirement for -\tcode{Readable}\iref{iterator.concept.readable}) and which can be both pre- and +\libconcept{readable}\iref{iterator.concept.readable}) and which can be both pre- and post-incremented. \begin{note} Unlike the \oldconcept{InputIterator} requirements\iref{input.iterators}, -the \libconcept{InputIterator} concept does not need +the \libconcept{input_iterator} concept does not need equality comparison since iterators are typically compared to sentinels. \end{note} -\indexlibrary{\idxcode{InputIterator}}% +\indexlibrary{\idxcode{input_iterator}}% \begin{codeblock} template - concept InputIterator = - Iterator && - Readable && + concept input_iterator = + input_or_output_iterator && + readable && requires { typename @\placeholdernc{ITER_CONCEPT}@(I); } && - DerivedFrom<@\placeholdernc{ITER_CONCEPT}@(I), input_iterator_tag>; + derived_from<@\placeholdernc{ITER_CONCEPT}@(I), input_iterator_tag>; \end{codeblock} -\rSec3[iterator.concept.output]{Concept \tcode{OutputIterator}} +\rSec3[iterator.concept.output]{Concept \libconcept{output_iterator}} \pnum -The \tcode{OutputIterator} concept defines requirements for a type that +The \libconcept{output_iterator} concept defines requirements for a type that can be used to write values (from the requirement for -\tcode{Writable}\iref{iterator.concept.writable}) and which can be both pre- and post-incremented. +\libconcept{writable}\iref{iterator.concept.writable}) and which can be both pre- and post-incremented. \begin{note} -Output iterators are not required to model \libconcept{EqualityComparable}. +Output iterators are not required to model \libconcept{equality_comparable}. \end{note} -\indexlibrary{\idxcode{OutputIterator}}% +\indexlibrary{\idxcode{output_iterator}}% \begin{codeblock} template - concept OutputIterator = - Iterator && - Writable && + concept output_iterator = + input_or_output_iterator && + writable && requires(I i, T&& t) { *i++ = std::forward(t); // not required to be equality-preserving }; @@ -1647,7 +1650,7 @@ \pnum Let \tcode{E} be an expression such that \tcode{decltype((E))} is \tcode{T}, and let \tcode{i} be a -dereferenceable object of type \tcode{I}. \tcode{I} and \tcode{T} model \tcode{OutputIterator} only if +dereferenceable object of type \tcode{I}. \tcode{I} and \tcode{T} model \tcode{\libconcept{output_iterator}} only if \tcode{*i++ = E;} has effects equivalent to: \begin{codeblock} *i = E; @@ -1660,21 +1663,21 @@ They should be single-pass algorithms. \end{note} -\rSec3[iterator.concept.forward]{Concept \tcode{ForwardIterator}} +\rSec3[iterator.concept.forward]{Concept \libconcept{forward_iterator}} \pnum -The \libconcept{ForwardIterator} concept adds +The \libconcept{forward_iterator} concept adds copyability, equality comparison, and the multi-pass guarantee, specified below. -\indexlibrary{\idxcode{ForwardIterator}}% +\indexlibrary{\idxcode{forward_iterator}}% \begin{codeblock} template - concept ForwardIterator = - InputIterator && - DerivedFrom<@\placeholdernc{ITER_CONCEPT}@(I), forward_iterator_tag> && - Incrementable && - Sentinel; + concept forward_iterator = + input_iterator && + derived_from<@\placeholdernc{ITER_CONCEPT}@(I), forward_iterator_tag> && + incrementable && + sentinel_for; \end{codeblock} \pnum @@ -1712,21 +1715,21 @@ allow the use of multi-pass one-directional algorithms with forward iterators. \end{note} -\rSec3[iterator.concept.bidir]{Concept \libconcept{BidirectionalIterator}} +\rSec3[iterator.concept.bidir]{Concept \libconcept{bidirectional_iterator}} \pnum -The \libconcept{BidirectionalIterator} concept adds the ability +The \libconcept{bidirectional_iterator} concept adds the ability to move an iterator backward as well as forward. -\indexlibrary{\idxcode{BidirectionalIterator}}% +\indexlibrary{\idxcode{bidirectional_iterator}}% \begin{codeblock} template - concept BidirectionalIterator = - ForwardIterator && - DerivedFrom<@\placeholdernc{ITER_CONCEPT}@(I), bidirectional_iterator_tag> && + concept bidirectional_iterator = + forward_iterator && + derived_from<@\placeholdernc{ITER_CONCEPT}@(I), bidirectional_iterator_tag> && requires(I i) { - { --i } -> Same; - { i-- } -> Same; + { --i } -> same_as; + { i-- } -> same_as; }; \end{codeblock} @@ -1737,7 +1740,7 @@ \pnum Let \tcode{a} and \tcode{b} be equal objects of type \tcode{I}. -\tcode{I} models \libconcept{BidirectionalIterator} only if: +\tcode{I} models \libconcept{bidirectional_iterator} only if: \begin{itemize} \item If \tcode{a} and \tcode{b} are decrementable, @@ -1753,29 +1756,29 @@ \tcode{bool(--(++a) == b)}. \end{itemize} -\rSec3[iterator.concept.random.access]{Concept \libconcept{RandomAccessIterator}} +\rSec3[iterator.concept.random.access]{Concept \libconcept{random_access_iterator}} \pnum -The \libconcept{RandomAccessIterator} concept adds support for +The \libconcept{random_access_iterator} concept adds support for constant-time advancement with \tcode{+=}, \tcode{+}, \tcode{-=}, and \tcode{-}, as well as the computation of distance in constant time with \tcode{-}. Random access iterators also support array notation via subscripting. -\indexlibrary{\idxcode{RandomAccessIterator}}% +\indexlibrary{\idxcode{random_access_iterator}}% \begin{codeblock} template - concept RandomAccessIterator = - BidirectionalIterator && - DerivedFrom<@\placeholdernc{ITER_CONCEPT}@(I), random_access_iterator_tag> && - StrictTotallyOrdered && - SizedSentinel && + concept random_access_iterator = + bidirectional_iterator && + derived_from<@\placeholdernc{ITER_CONCEPT}@(I), random_access_iterator_tag> && + totally_ordered && + sized_sentinel_for && requires(I i, const I j, const iter_difference_t n) { - { i += n } -> Same; - { j + n } -> Same; - { n + j } -> Same; - { i -= n } -> Same; - { j - n } -> Same; - { j[n] } -> Same>; + { i += n } -> same_as; + { j + n } -> same_as; + { n + j } -> same_as; + { i -= n } -> same_as; + { j - n } -> same_as; + { j[n] } -> same_as>; }; \end{codeblock} @@ -1785,7 +1788,7 @@ after \tcode{n} applications of \tcode{++a}, let \tcode{D} be \tcode{iter_difference_t}, and let \tcode{n} denote a value of type \tcode{D}. -\tcode{I} models \libconcept{RandomAccessIterator} only if +\tcode{I} models \libconcept{random_access_iterator} only if \begin{itemize} \item \tcode{(a += n)} is equal to \tcode{b}. @@ -1807,22 +1810,22 @@ \item \tcode{bool(a <= b)} is \tcode{true}. \end{itemize} -\rSec3[iterator.concept.contiguous]{Concept \libconcept{ContiguousIterator}} +\rSec3[iterator.concept.contiguous]{Concept \libconcept{contiguous_iterator}} \pnum -The \libconcept{ContiguousIterator} concept provides a guarantee that +The \libconcept{contiguous_iterator} concept provides a guarantee that the denoted elements are stored contiguously in memory. -\indexlibrary{\idxcode{ContiguousIterator}}% +\indexlibrary{\idxcode{contiguous_iterator}}% \begin{codeblock} template - concept @\libconcept{ContiguousIterator}@ = - RandomAccessIterator && - DerivedFrom<@\placeholdernc{ITER_CONCEPT}@(I), contiguous_iterator_tag> && + concept @\libconcept{contiguous_iterator}@ = + random_access_iterator && + derived_from<@\placeholdernc{ITER_CONCEPT}@(I), contiguous_iterator_tag> && is_lvalue_reference_v> && - Same, remove_cvref_t>> && + same_as, remove_cvref_t>> && requires(const I& i) { - { to_address(i) } -> Same>>; + { to_address(i) } -> same_as>>; }; \end{codeblock} @@ -1832,7 +1835,7 @@ such that \tcode{b} is reachable from \tcode{a} and \tcode{c} is reachable from \tcode{b}, and let \tcode{D} be \tcode{iter_difference_t}. -The type \tcode{I} models \libconcept{ContiguousIterator} only if +The type \tcode{I} models \libconcept{contiguous_iterator} only if \begin{itemize} \item \tcode{to_address(a) == addressof(*a)}, \item \tcode{to_address(b) == to_address(a) + D(b - a)}, and @@ -2313,62 +2316,62 @@ The indirect callable concepts are used to constrain those algorithms that accept callable objects~(\ref{func.def}) as arguments. -\indexlibrary{\idxcode{IndirectUnaryInvocable}}% -\indexlibrary{\idxcode{IndirectRegularUnaryInvocable}}% -\indexlibrary{\idxcode{IndirectUnaryPredicate}}% -\indexlibrary{\idxcode{IndirectRelation}}% -\indexlibrary{\idxcode{IndirectStrictWeakOrder}}% +\indexlibrary{\idxcode{indirectly_unary_invocable}}% +\indexlibrary{\idxcode{indirectly_regular_unary_invocable}}% +\indexlibrary{\idxcode{indirect_unary_predicate}}% +\indexlibrary{\idxcode{indirect_relation}}% +\indexlibrary{\idxcode{indirect_strict_weak_order}}% \begin{codeblock} namespace std { template - concept IndirectUnaryInvocable = - Readable && - CopyConstructible && - Invocable&> && - Invocable> && - Invocable> && - CommonReference< + concept indirectly_unary_invocable = + readable && + copy_constructible && + invocable&> && + invocable> && + invocable> && + common_reference_with< invoke_result_t&>, invoke_result_t>>; template - concept IndirectRegularUnaryInvocable = - Readable && - CopyConstructible && - RegularInvocable&> && - RegularInvocable> && - RegularInvocable> && - CommonReference< + concept indirectly_regular_unary_invocable = + readable && + copy_constructible && + regular_invocable&> && + regular_invocable> && + regular_invocable> && + common_reference_with< invoke_result_t&>, invoke_result_t>>; template - concept IndirectUnaryPredicate = - Readable && - CopyConstructible && - Predicate&> && - Predicate> && - Predicate>; + concept indirect_unary_predicate = + readable && + copy_constructible && + predicate&> && + predicate> && + predicate>; template - concept IndirectRelation = - Readable && Readable && - CopyConstructible && - Relation&, iter_value_t&> && - Relation&, iter_reference_t> && - Relation, iter_value_t&> && - Relation, iter_reference_t> && - Relation, iter_common_reference_t>; + concept indirect_relation = + readable && readable && + copy_constructible && + relation&, iter_value_t&> && + relation&, iter_reference_t> && + relation, iter_value_t&> && + relation, iter_reference_t> && + relation, iter_common_reference_t>; template - concept IndirectStrictWeakOrder = - Readable && Readable && - CopyConstructible && - StrictWeakOrder&, iter_value_t&> && - StrictWeakOrder&, iter_reference_t> && - StrictWeakOrder, iter_value_t&> && - StrictWeakOrder, iter_reference_t> && - StrictWeakOrder, iter_common_reference_t>; + concept indirect_strict_weak_order = + readable && readable && + copy_constructible && + strict_weak_order&, iter_value_t&> && + strict_weak_order&, iter_reference_t> && + strict_weak_order, iter_value_t&> && + strict_weak_order, iter_reference_t> && + strict_weak_order, iter_common_reference_t>; } \end{codeblock} @@ -2377,21 +2380,21 @@ \pnum Class template \tcode{projected} is used to constrain algorithms that accept callable objects and projections\iref{defns.projection}. -It combines a \libconcept{Readable} type \tcode{I} and -a callable object type \tcode{Proj} into a new \libconcept{Readable} type +It combines a \libconcept{readable} type \tcode{I} and +a callable object type \tcode{Proj} into a new \libconcept{readable} type whose \tcode{reference} type is the result of applying \tcode{Proj} to the \tcode{iter_reference_t} of \tcode{I}. \indexlibrary{\idxcode{projected}}% \begin{codeblock} namespace std { - template Proj> + template Proj> struct projected { using value_type = remove_cvref_t>; indirect_result_t operator*() const; // \notdef }; - template + template struct incrementable_traits> { using difference_type = iter_difference_t; }; @@ -2407,17 +2410,17 @@ to families of algorithms. These group together iterator requirements of algorithm families. There are three relational concepts that specify -how element values are transferred between \libconcept{Readable} and -\libconcept{Writable} types: -\libconcept{Indirectly\-Movable}, -\libconcept{Indir\-ect\-ly\-Copy\-able}, and -\libconcept{Indirectly\-Swappable}. +how element values are transferred between \libconcept{readable} and +\libconcept{writable} types: +\libconcept{indirectly_movable}, +\libconcept{indirectly_copyable}, and +\libconcept{indirectly_swappable}. There are three relational concepts for rearrangements: -\libconcept{Permut\-able}, -\libconcept{Mergeable}, and -\libconcept{Sortable}. +\libconcept{permutable}, +\libconcept{mergeable}, and +\libconcept{sortable}. There is one relational concept for comparing values from different sequences: -\libconcept{IndirectlyComparable}. +\libconcept{indirectly_comparable}. \pnum \begin{note} @@ -2426,41 +2429,41 @@ in addition to those that appear in the concepts' bodies\iref{range.cmp}. \end{note} -\rSec3[alg.req.ind.move]{Concept \libconcept{IndirectlyMovable}} +\rSec3[alg.req.ind.move]{Concept \libconcept{indirectly_movable}} \pnum -The \libconcept{IndirectlyMovable} concept specifies the relationship between -a \libconcept{Readable} type and a \libconcept{Writable} type between which +The \libconcept{indirectly_movable} concept specifies the relationship between +a \libconcept{readable} type and a \libconcept{writable} type between which values may be moved. -\indexlibrary{\idxcode{IndirectlyMovable}}% +\indexlibrary{\idxcode{indirectly_movable}}% \begin{codeblock} template - concept IndirectlyMovable = - Readable && - Writable>; + concept indirectly_movable = + readable && + writable>; \end{codeblock} \pnum -The \libconcept{IndirectlyMovableStorable} concept augments -\libconcept{IndirectlyMovable} with additional requirements enabling +The \libconcept{indirectly_movable_storable} concept augments +\libconcept{indirectly_movable} with additional requirements enabling the transfer to be performed through an intermediate object of the -\libconcept{Readable} type's value type. +\libconcept{readable} type's value type. -\indexlibrary{\idxcode{IndirectlyMovableStorable}}% +\indexlibrary{\idxcode{indirectly_movable_storable}}% \begin{codeblock} template - concept IndirectlyMovableStorable = - IndirectlyMovable && - Writable> && - Movable> && - Constructible, iter_rvalue_reference_t> && - Assignable&, iter_rvalue_reference_t>; + concept indirectly_movable_storable = + indirectly_movable && + writable> && + movable> && + constructible_from, iter_rvalue_reference_t> && + assignable_from&, iter_rvalue_reference_t>; \end{codeblock} \pnum Let \tcode{i} be a dereferenceable value of type \tcode{In}. -\tcode{In} and \tcode{Out} model \tcode{IndirectlyMovableStorable} +\tcode{In} and \tcode{Out} model \tcode{\libconcept{indirectly_movable_storable}} only if after the initialization of the object \tcode{obj} in \begin{codeblock} iter_value_t obj(ranges::iter_move(i)); @@ -2470,42 +2473,42 @@ the resulting state of the value denoted by \tcode{*i} is valid but unspecified\iref{lib.types.movedfrom}. -\rSec3[alg.req.ind.copy]{Concept \libconcept{IndirectlyCopyable}} +\rSec3[alg.req.ind.copy]{Concept \libconcept{indirectly_copyable}} \pnum -The \libconcept{IndirectlyCopyable} concept specifies the relationship between -a \libconcept{Readable} type and a \libconcept{Writable} type between which +The \libconcept{indirectly_copyable} concept specifies the relationship between +a \libconcept{readable} type and a \libconcept{writable} type between which values may be copied. -\indexlibrary{\idxcode{IndirectlyCopyable}}% +\indexlibrary{\idxcode{indirectly_copyable}}% \begin{codeblock} template - concept IndirectlyCopyable = - Readable && - Writable>; + concept indirectly_copyable = + readable && + writable>; \end{codeblock} \pnum -The \libconcept{IndirectlyCopyableStorable} concept augments -\libconcept{IndirectlyCopyable} with additional requirements enabling +The \libconcept{indirectly_copyable_storable} concept augments +\libconcept{indirectly_copyable} with additional requirements enabling the transfer to be performed through an intermediate object of the -\libconcept{Readable} type's value type. It also requires the capability +\libconcept{readable} type's value type. It also requires the capability to make copies of values. -\indexlibrary{\idxcode{IndirectlyCopyableStorable}}% +\indexlibrary{\idxcode{indirectly_copyable_storable}}% \begin{codeblock} template - concept IndirectlyCopyableStorable = - IndirectlyCopyable && - Writable&> && - Copyable> && - Constructible, iter_reference_t> && - Assignable&, iter_reference_t>; + concept indirectly_copyable_storable = + indirectly_copyable && + writable&> && + copyable> && + constructible_from, iter_reference_t> && + assignable_from&, iter_reference_t>; \end{codeblock} \pnum Let \tcode{i} be a dereferenceable value of type \tcode{In}. -\tcode{In} and \tcode{Out} model \tcode{IndirectlyCopyableStorable} +\tcode{In} and \tcode{Out} model \tcode{\libconcept{indirectly_copyable_storable}} only if after the initialization of the object \tcode{obj} in \begin{codeblock} iter_value_t obj(*i); @@ -2515,17 +2518,17 @@ of the value denoted by \tcode{*i} is valid but unspecified\iref{lib.types.movedfrom}. -\rSec3[alg.req.ind.swap]{Concept \libconcept{IndirectlySwappable}} +\rSec3[alg.req.ind.swap]{Concept \libconcept{indirectly_swappable}} \pnum -The \libconcept{IndirectlySwappable} concept specifies a swappable relationship -between the values referenced by two \libconcept{Readable} types. +The \libconcept{indirectly_swappable} concept specifies a swappable relationship +between the values referenced by two \libconcept{readable} types. -\indexlibrary{\idxcode{IndirectlySwappable}}% +\indexlibrary{\idxcode{indirectly_swappable}}% \begin{codeblock} template - concept IndirectlySwappable = - Readable && Readable && + concept indirectly_swappable = + readable && readable && requires(I1& i1, I2& i2) { ranges::iter_swap(i1, i1); ranges::iter_swap(i2, i2); @@ -2534,67 +2537,67 @@ }; \end{codeblock} -\rSec3[alg.req.ind.cmp]{Concept \libconcept{IndirectlyComparable}} +\rSec3[alg.req.ind.cmp]{Concept \libconcept{indirectly_comparable}} \pnum -The \libconcept{IndirectlyComparable} concept specifies +The \libconcept{indirectly_comparable} concept specifies the common requirements of algorithms that compare values from two different sequences. -\indexlibrary{\idxcode{IndirectlyComparable}}% +\indexlibrary{\idxcode{indirectly_comparable}}% \begin{codeblock} template - concept IndirectlyComparable = - IndirectRelation, projected>; + concept indirectly_comparable = + indirect_relation, projected>; \end{codeblock} -\rSec3[alg.req.permutable]{Concept \libconcept{Permutable}} +\rSec3[alg.req.permutable]{Concept \libconcept{permutable}} \pnum -The \libconcept{Permutable} concept specifies the common requirements +The \libconcept{permutable} concept specifies the common requirements of algorithms that reorder elements in place by moving or swapping them. -\indexlibrary{\idxcode{Permutable}}% +\indexlibrary{\idxcode{permutable}}% \begin{codeblock} template - concept Permutable = - ForwardIterator && - IndirectlyMovableStorable && - IndirectlySwappable; + concept permutable = + forward_iterator && + indirectly_movable_storable && + indirectly_swappable; \end{codeblock} -\rSec3[alg.req.mergeable]{Concept \libconcept{Mergeable}} +\rSec3[alg.req.mergeable]{Concept \libconcept{mergeable}} \pnum -The \libconcept{Mergeable} concept specifies the requirements of algorithms +The \libconcept{mergeable} concept specifies the requirements of algorithms that merge sorted sequences into an output sequence by copying elements. -\indexlibrary{\idxcode{Mergeable}}% +\indexlibrary{\idxcode{mergeable}}% \begin{codeblock} template - concept Mergeable = - InputIterator && - InputIterator && - WeaklyIncrementable && - IndirectlyCopyable && - IndirectlyCopyable && - IndirectStrictWeakOrder, projected>; + concept mergeable = + input_iterator && + input_iterator && + weakly_incrementable && + indirectly_copyable && + indirectly_copyable && + indirect_strict_weak_order, projected>; \end{codeblock} -\rSec3[alg.req.sortable]{Concept \libconcept{Sortable}} +\rSec3[alg.req.sortable]{Concept \libconcept{sortable}} \pnum -The \libconcept{Sortable} concept specifies the common requirements of +The \libconcept{sortable} concept specifies the common requirements of algorithms that permute sequences into ordered sequences (e.g., \tcode{sort}). -\indexlibrary{\idxcode{Sortable}}% +\indexlibrary{\idxcode{sortable}}% \begin{codeblock} template - concept Sortable = - Permutable && - IndirectStrictWeakOrder>; + concept sortable = + permutable && + indirect_strict_weak_order>; \end{codeblock} \rSec1[iterator.primitives]{Iterator primitives} @@ -2800,8 +2803,8 @@ possible for a concrete iterator type. \begin{example} \tcode{ranges::advance} uses the \tcode{+} operator to move a -\libconcept{RandomAccessIterator} forward \tcode{n} steps in constant time. -For an iterator type that does not model \libconcept{RandomAccessIterator}, +\libconcept{random_access_iterator} forward \tcode{n} steps in constant time. +For an iterator type that does not model \libconcept{random_access_iterator}, \tcode{ranges::advance} instead performs \tcode{n} individual increments with the \tcode{++} operator. \end{example} @@ -2838,20 +2841,20 @@ \indexlibrary{\idxcode{advance}}% \begin{itemdecl} -template +template constexpr void ranges::advance(I& i, iter_difference_t n); \end{itemdecl} \begin{itemdescr} \pnum \expects -If \tcode{I} does not model \libconcept{BidirectionalIterator}, +If \tcode{I} does not model \libconcept{bidirectional_iterator}, \tcode{n} is not negative. \pnum \effects \begin{itemize} -\item If \tcode{I} models \libconcept{RandomAccessIterator}, +\item If \tcode{I} models \libconcept{random_access_iterator}, equivalent to \tcode{i += n}. \item Otherwise, if \tcode{n} is non-negative, increments \tcode{i} by \tcode{n}. @@ -2861,7 +2864,7 @@ \indexlibrary{\idxcode{advance}}% \begin{itemdecl} -template S> +template S> constexpr void ranges::advance(I& i, S bound); \end{itemdecl} @@ -2873,9 +2876,9 @@ \pnum \effects \begin{itemize} -\item If \tcode{I} and \tcode{S} model \tcode{Assignable}, +\item If \tcode{I} and \tcode{S} model \tcode{\libconcept{assignable_from}}, equivalent to \tcode{i = std::move(bound)}. -\item Otherwise, if \tcode{S} and \tcode{I} model \tcode{SizedSentinel}, +\item Otherwise, if \tcode{S} and \tcode{I} model \tcode{\libconcept{sized_sentinel_for}}, equivalent to \tcode{ranges::advance(i, bound - i)}. \item Otherwise, while \tcode{bool(i != bound)} is \tcode{true}, increments \tcode{i}. @@ -2884,7 +2887,7 @@ \indexlibrary{\idxcode{advance}}% \begin{itemdecl} -template S> +template S> constexpr iter_difference_t ranges::advance(I& i, iter_difference_t n, S bound); \end{itemdecl} @@ -2894,13 +2897,13 @@ If \tcode{n > 0}, \range{i}{bound} denotes a range. If \tcode{n == 0}, \range{i}{bound} or \range{bound}{i} denotes a range. If \tcode{n < 0}, \range{bound}{i} denotes a range, -\tcode{I} models \libconcept{BidirectionalIterator}, and -\tcode{I} and \tcode{S} model \tcode{Same}. +\tcode{I} models \libconcept{bidirectional_iterator}, and +\tcode{I} and \tcode{S} model \tcode{\libconcept{same_as}}. \pnum \effects \begin{itemize} -\item If \tcode{S} and \tcode{I} model \tcode{SizedSentinel}: +\item If \tcode{S} and \tcode{I} model \tcode{\libconcept{sized_sentinel_for}}: \begin{itemize} \item If \brk{}$|\tcode{n}| \ge |\tcode{bound - i}|$, equivalent to \tcode{ranges::advance(i, bound)}. @@ -2926,7 +2929,7 @@ \rSec3[range.iter.op.distance]{\tcode{ranges::distance}} \indexlibrary{\idxcode{distance}}% \begin{itemdecl} -template S> +template S> constexpr iter_difference_t ranges::distance(I first, S last); \end{itemdecl} @@ -2936,11 +2939,11 @@ \range{first}{last} denotes a range, or \range{last}{first} denotes a range and \tcode{S} and \tcode{I} model -\tcode{Same \&\& SizedSentinel}. +\tcode{same_as \&\& sized_sentinel_for}. \pnum \effects -If \tcode{S} and \tcode{I} model \tcode{SizedSentinel}, +If \tcode{S} and \tcode{I} model \tcode{\libconcept{sized_sentinel_for}}, returns \tcode{(last - first)}; otherwise, returns the number of increments needed to get from \tcode{first} @@ -2950,14 +2953,14 @@ \indexlibrary{\idxcode{distance}}% \begin{itemdecl} -template +template constexpr range_difference_t ranges::distance(R&& r); \end{itemdecl} \begin{itemdescr} \pnum \effects -If \tcode{R} models \libconcept{SizedRange}, equivalent to: +If \tcode{R} models \libconcept{sized_range}, equivalent to: \begin{codeblock} return static_cast>(ranges::size(r)); // \ref{range.prim.size} \end{codeblock} @@ -2971,7 +2974,7 @@ \indexlibrary{\idxcode{next}}% \begin{itemdecl} -template +template constexpr I ranges::next(I x); \end{itemdecl} @@ -2982,7 +2985,7 @@ \indexlibrary{\idxcode{next}}% \begin{itemdecl} -template +template constexpr I ranges::next(I x, iter_difference_t n); \end{itemdecl} @@ -2993,7 +2996,7 @@ \indexlibrary{\idxcode{next}}% \begin{itemdecl} -template S> +template S> constexpr I ranges::next(I x, S bound); \end{itemdecl} @@ -3004,7 +3007,7 @@ \indexlibrary{\idxcode{next}}% \begin{itemdecl} -template S> +template S> constexpr I ranges::next(I x, iter_difference_t n, S bound); \end{itemdecl} @@ -3016,7 +3019,7 @@ \rSec3[range.iter.op.prev]{\tcode{ranges::prev}} \indexlibrary{\idxcode{prev}}% \begin{itemdecl} -template +template constexpr I ranges::prev(I x); \end{itemdecl} @@ -3027,7 +3030,7 @@ \indexlibrary{\idxcode{prev}}% \begin{itemdecl} -template +template constexpr I ranges::prev(I x, iter_difference_t n); \end{itemdecl} @@ -3038,7 +3041,7 @@ \indexlibrary{\idxcode{prev}}% \begin{itemdecl} -template +template constexpr I ranges::prev(I x, iter_difference_t n, I bound); \end{itemdecl} @@ -3092,7 +3095,7 @@ friend constexpr iter_rvalue_reference_t iter_move(const reverse_iterator& i) noexcept(@\seebelow@); - template Iterator2> + template Iterator2> friend constexpr void iter_swap(const reverse_iterator& x, const reverse_iterator& y) noexcept(@\seebelow@); @@ -3108,7 +3111,7 @@ \begin{itemize} \item \tcode{random_access_iterator_tag} if \tcode{Iterator} models -\libconcept{RandomAccessIterator}, and +\libconcept{random_access_iterator}, and \item \tcode{bidirectional_iterator_tag} otherwise. \end{itemize} @@ -3120,7 +3123,7 @@ \tcode{random_access_iterator_tag} if the type \tcode{iterator_traits<\brk{}Iterator>::iterator_category} models -\libconcept{DerivedFrom}, and +\tcode{\libconcept{derived_from}}, and \item \tcode{iterator_traits<\brk{}Iterator>::iterator_category} otherwise. \end{itemize} @@ -3133,7 +3136,7 @@ shall either meet the requirements of a \oldconcept{BidirectionalIterator}\iref{bidirectional.iterators} or model -\libconcept{BidirectionalIterator}\iref{iterator.concept.bidir}. +\libconcept{bidirectional_iterator}\iref{iterator.concept.bidir}. \pnum Additionally, @@ -3141,7 +3144,7 @@ shall either meet the requirements of a \oldconcept{RandomAccessIterator}\iref{random.access.iterators} or model -\libconcept{RandomAccessIterator}\iref{iterator.concept.random.access} +\libconcept{random_access_iterator}\iref{iterator.concept.random.access} if the definitions of any of the members \begin{itemize} \item @@ -3521,7 +3524,7 @@ \indexlibrarymember{operator<=>}{reverse_iterator}% \begin{itemdecl} -template Iterator2> +template Iterator2> constexpr compare_three_way_result_t operator<=>(const reverse_iterator& x, const reverse_iterator& y); @@ -3593,7 +3596,7 @@ \indexlibrarymember{iter_swap}{reverse_iterator}% \begin{itemdecl} -template Iterator2> +template Iterator2> friend constexpr void iter_swap(const reverse_iterator& x, const reverse_iterator& y) noexcept(@\seebelow@); @@ -4086,19 +4089,19 @@ constexpr move_iterator& operator-=(difference_type n); constexpr reference operator[](difference_type n) const; - template S> + template S> friend constexpr bool operator==(const move_iterator& x, const move_sentinel& y); - template S> + template S> friend constexpr iter_difference_t operator-(const move_sentinel& x, const move_iterator& y); - template S> + template S> friend constexpr iter_difference_t operator-(const move_iterator& x, const move_sentinel& y); friend constexpr iter_rvalue_reference_t iter_move(const move_iterator& i) noexcept(noexcept(ranges::iter_move(i.current))); - template Iterator2> + template Iterator2> friend constexpr void iter_swap(const move_iterator& x, const move_iterator& y) noexcept(noexcept(ranges::iter_swap(x.current, y.current))); @@ -4116,7 +4119,7 @@ \tcode{random_access_iterator_tag} if the type \tcode{iterator_traits<\brk{}Iterator>::iterator_category} models -\libconcept{DerivedFrom<\tcode{random_access_iterator_tag}>}, and +\tcode{\libconcept{derived_from}}, and \item \tcode{iterator_traits<\brk{}Iterator>::iterator_category} otherwise. \end{itemize} @@ -4126,16 +4129,16 @@ \pnum The template parameter \tcode{Iterator} shall either meet the \oldconcept{InputIterator} requirements\iref{input.iterators} -or model \libconcept{InputIterator}\iref{iterator.concept.input}. +or model \libconcept{input_iterator}\iref{iterator.concept.input}. Additionally, if any of the bidirectional traversal functions are instantiated, the template parameter shall either meet the \oldconcept{BidirectionalIterator} requirements\iref{bidirectional.iterators} -or model \libconcept{BidirectionalIterator}\iref{iterator.concept.bidir}. +or model \libconcept{bidirectional_iterator}\iref{iterator.concept.bidir}. If any of the random access traversal functions are instantiated, the template parameter shall either meet the \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators} or model -\libconcept{RandomAccess\-Iterator}\iref{iterator.concept.random.access}. +\libconcept{random_access_iterator}\iref{iterator.concept.random.access}. \rSec3[move.iter.cons]{Construction and assignment} @@ -4202,10 +4205,10 @@ \begin{itemdescr} \pnum -\constraints \tcode{Iterator} satisfies \libconcept{CopyConstructible}. +\constraints \tcode{Iterator} satisfies \libconcept{copy_constructible}. \pnum -\expects \tcode{Iterator} models \libconcept{CopyConstructible}. +\expects \tcode{Iterator} models \libconcept{copy_constructible}. \pnum \returns \tcode{current}. @@ -4266,7 +4269,7 @@ \begin{itemdescr} \pnum \effects -If \tcode{Iterator} models \libconcept{ForwardIterator}, equivalent to: +If \tcode{Iterator} models \libconcept{forward_iterator}, equivalent to: \begin{codeblock} move_iterator tmp = *this; ++current; @@ -4357,7 +4360,7 @@ template constexpr bool operator==(const move_iterator& x, const move_iterator& y); -template S> +template S> friend constexpr bool operator==(const move_iterator& x, const move_sentinel& y); \end{itemdecl} @@ -4438,7 +4441,7 @@ \indexlibrarymember{operator<=>}{move_iterator}% \begin{itemdecl} -template Iterator2> +template Iterator2> constexpr compare_three_way_result_t operator<=>(const move_iterator& x, const move_iterator& y); @@ -4458,10 +4461,10 @@ constexpr auto operator-(const move_iterator& x, const move_iterator& y) -> decltype(x.base() - y.base()); -template S> +template S> friend constexpr iter_difference_t operator-(const move_sentinel& x, const move_iterator& y); -template S> +template S> friend constexpr iter_difference_t operator-(const move_iterator& x, const move_sentinel& y); \end{itemdecl} @@ -4501,7 +4504,7 @@ \indexlibrarymember{iter_swap}{move_iterator}% \begin{itemdecl} -template Iterator2> +template Iterator2> friend constexpr void iter_swap(const move_iterator& x, const move_iterator& y) noexcept(noexcept(ranges::iter_swap(x.current, y.current))); @@ -4528,9 +4531,9 @@ \pnum Class template \tcode{move_sentinel} is a sentinel adaptor useful for denoting ranges together with \tcode{move_iterator}. When an input iterator type -\tcode{I} and sentinel type \tcode{S} model \tcode{Sentinel}, +\tcode{I} and sentinel type \tcode{S} model \tcode{\libconcept{sentinel_for}}, \tcode{move_sentinel} and \tcode{move_iterator} model -\tcode{Sentinel, move_iterator{>}} as well. +\tcode{sentinel_for, move_iterator{>}} as well. \pnum \begin{example} @@ -4538,9 +4541,9 @@ \tcode{copy_if} using \tcode{move_iterator} and \tcode{move_sentinel}: \begin{codeblock} -template S, WeaklyIncrementable O, - IndirectUnaryPredicate Pred> - requires IndirectlyMovable +template S, weakly_incrementable O, + indirect_unary_predicate Pred> + requires indirectly_movable void move_if(I first, S last, O out, Pred pred) { std::ranges::copy_if(move_iterator{first}, move_sentinel{last}, out, pred); } @@ -4550,16 +4553,16 @@ \indexlibrary{\idxcode{move_sentinel}}% \begin{codeblock} namespace std { - template + template class move_sentinel { public: constexpr move_sentinel(); constexpr explicit move_sentinel(S s); template - requires ConvertibleTo + requires convertible_to constexpr move_sentinel(const move_sentinel& s); template - requires Assignable + requires assignable_from constexpr move_sentinel& operator=(const move_sentinel& s); constexpr S base() const; @@ -4596,7 +4599,7 @@ \indexlibrary{\idxcode{move_sentinel}!constructor}% \begin{itemdecl} template - requires ConvertibleTo + requires convertible_to constexpr move_sentinel(const move_sentinel& s); \end{itemdecl} @@ -4609,7 +4612,7 @@ \indexlibrary{\idxcode{move_sentinel}!\idxcode{operator=}}% \begin{itemdecl} template - requires Assignable + requires assignable_from constexpr move_sentinel& operator=(const move_sentinel& s); \end{itemdecl} @@ -4652,20 +4655,20 @@ \indexlibrary{\idxcode{common_iterator}}% \begin{codeblock} namespace std { - template S> - requires (!Same) + template S> + requires (!same_as) class common_iterator { public: constexpr common_iterator() = default; constexpr common_iterator(I i); constexpr common_iterator(S s); template - requires ConvertibleTo && ConvertibleTo + requires convertible_to && convertible_to constexpr common_iterator(const common_iterator& x); template - requires ConvertibleTo && ConvertibleTo && - Assignable && Assignable + requires convertible_to && convertible_to && + assignable_from && assignable_from common_iterator& operator=(const common_iterator& x); decltype(auto) operator*(); @@ -4677,24 +4680,24 @@ common_iterator& operator++(); decltype(auto) operator++(int); - template S2> - requires Sentinel + template S2> + requires sentinel_for friend bool operator==( const common_iterator& x, const common_iterator& y); - template S2> - requires Sentinel && EqualityComparableWith + template S2> + requires sentinel_for && equality_comparable_with friend bool operator==( const common_iterator& x, const common_iterator& y); - template I2, SizedSentinel S2> - requires SizedSentinel + template I2, sized_sentinel_for S2> + requires sized_sentinel_for friend iter_difference_t operator-( const common_iterator& x, const common_iterator& y); friend iter_rvalue_reference_t iter_move(const common_iterator& i) noexcept(noexcept(ranges::iter_move(declval()))) - requires InputIterator; - template I2, class S2> + requires input_iterator; + template I2, class S2> friend void iter_swap(const common_iterator& x, const common_iterator& y) noexcept(noexcept(ranges::iter_swap(declval(), declval()))); @@ -4707,7 +4710,7 @@ using difference_type = iter_difference_t; }; - template + template struct iterator_traits> { using iterator_concept = @\seebelow@; using iterator_category = @\seebelow@; @@ -4727,14 +4730,14 @@ \begin{itemize} \item \tcode{iterator_concept} denotes \tcode{forward_iterator_tag} -if \tcode{I} models \libconcept{ForwardIterator}; +if \tcode{I} models \libconcept{forward_iterator}; otherwise it denotes \tcode{input_iterator_tag}. \item \tcode{iterator_category} denotes \tcode{forward_iterator_tag} if \tcode{iterator_traits::iterator_category} -models \tcode{DerivedFrom}; +models \tcode{derived_from}; otherwise it denotes \tcode{input_iterator_tag}. \item @@ -4771,7 +4774,7 @@ \indexlibrary{\idxcode{common_iterator}!constructor}% \begin{itemdecl} template - requires ConvertibleTo && ConvertibleTo + requires convertible_to && convertible_to constexpr common_iterator(const common_iterator& x); \end{itemdecl} @@ -4789,8 +4792,8 @@ \indexlibrarymember{operator=}{common_iterator}% \begin{itemdecl} template - requires ConvertibleTo && ConvertibleTo && - Assignable && Assignable + requires convertible_to && convertible_to && + assignable_from && assignable_from common_iterator& operator=(const common_iterator& x); \end{itemdecl} @@ -4840,10 +4843,10 @@ \pnum The expression in the requires clause is equivalent to: \begin{codeblock} -Readable && +readable && (requires(const I& i) { i.operator->(); } || is_reference_v> || - Constructible, iter_reference_t>) + constructible_from, iter_reference_t>) \end{codeblock} \pnum @@ -4911,7 +4914,7 @@ \pnum \effects -If \tcode{I} models \libconcept{ForwardIterator}, equivalent to: +If \tcode{I} models \libconcept{forward_iterator}, equivalent to: \begin{codeblock} common_iterator tmp = *this; ++*this; @@ -4924,8 +4927,8 @@ \indexlibrarymember{operator==}{common_iterator}% \begin{itemdecl} -template S2> - requires Sentinel +template S2> + requires sentinel_for friend bool operator==( const common_iterator& x, const common_iterator& y); \end{itemdecl} @@ -4945,8 +4948,8 @@ \indexlibrarymember{operator==}{common_iterator}% \begin{itemdecl} -template S2> - requires Sentinel && EqualityComparableWith +template S2> + requires sentinel_for && equality_comparable_with friend bool operator==( const common_iterator& x, const common_iterator& y); \end{itemdecl} @@ -4966,8 +4969,8 @@ \indexlibrarymember{operator-}{common_iterator}% \begin{itemdecl} -template I2, SizedSentinel S2> - requires SizedSentinel +template I2, sized_sentinel_for S2> + requires sized_sentinel_for friend iter_difference_t operator-( const common_iterator& x, const common_iterator& y); \end{itemdecl} @@ -4991,7 +4994,7 @@ \begin{itemdecl} friend iter_rvalue_reference_t iter_move(const common_iterator& i) noexcept(noexcept(ranges::iter_move(declval()))) - requires InputIterator; + requires input_iterator; \end{itemdecl} \begin{itemdescr} @@ -5004,7 +5007,7 @@ \indexlibrarymember{iter_swap}{common_iterator}% \begin{itemdecl} -template I2, class S2> +template I2, class S2> friend void iter_swap(const common_iterator& x, const common_iterator& y) noexcept(noexcept(ranges::iter_swap(declval(), declval()))); \end{itemdecl} @@ -5071,7 +5074,7 @@ \indexlibrary{\idxcode{counted_iterator}}% \begin{codeblock} namespace std { - template + template class counted_iterator { public: using iterator_type = I; @@ -5079,14 +5082,14 @@ constexpr counted_iterator() = default; constexpr counted_iterator(I x, iter_difference_t n); template - requires ConvertibleTo + requires convertible_to constexpr counted_iterator(const counted_iterator& x); template - requires Assignable + requires assignable_from constexpr counted_iterator& operator=(const counted_iterator& x); - constexpr I base() const & requires CopyConstructible; + constexpr I base() const & requires copy_constructible; constexpr I base() &&; constexpr iter_difference_t count() const noexcept; constexpr decltype(auto) operator*(); @@ -5096,23 +5099,23 @@ constexpr counted_iterator& operator++(); decltype(auto) operator++(int); constexpr counted_iterator operator++(int) - requires ForwardIterator; + requires forward_iterator; constexpr counted_iterator& operator--() - requires BidirectionalIterator; + requires bidirectional_iterator; constexpr counted_iterator operator--(int) - requires BidirectionalIterator; + requires bidirectional_iterator; constexpr counted_iterator operator+(iter_difference_t n) const - requires RandomAccessIterator; + requires random_access_iterator; friend constexpr counted_iterator operator+( iter_difference_t n, const counted_iterator& x) - requires RandomAccessIterator; + requires random_access_iterator; constexpr counted_iterator& operator+=(iter_difference_t n) - requires RandomAccessIterator; + requires random_access_iterator; constexpr counted_iterator operator-(iter_difference_t n) const - requires RandomAccessIterator; - template I2> + requires random_access_iterator; + template I2> friend constexpr iter_difference_t operator-( const counted_iterator& x, const counted_iterator& y); friend constexpr iter_difference_t operator-( @@ -5120,25 +5123,25 @@ friend constexpr iter_difference_t operator-( default_sentinel_t, const counted_iterator& y); constexpr counted_iterator& operator-=(iter_difference_t n) - requires RandomAccessIterator; + requires random_access_iterator; constexpr decltype(auto) operator[](iter_difference_t n) const - requires RandomAccessIterator; + requires random_access_iterator; - template I2> + template I2> friend constexpr bool operator==( const counted_iterator& x, const counted_iterator& y); friend constexpr bool operator==( const counted_iterator& x, default_sentinel_t); - template I2> + template I2> friend constexpr strong_ordering operator<=>( const counted_iterator& x, const counted_iterator& y); friend constexpr iter_rvalue_reference_t iter_move(const counted_iterator& i) noexcept(noexcept(ranges::iter_move(i.current))) - requires InputIterator; - template I2> + requires input_iterator; + template I2> friend constexpr void iter_swap(const counted_iterator& x, const counted_iterator& y) noexcept(noexcept(ranges::iter_swap(x.current, y.current))); @@ -5152,7 +5155,7 @@ using difference_type = iter_difference_t; }; - template + template struct iterator_traits> : iterator_traits { using pointer = void; }; @@ -5179,7 +5182,7 @@ \indexlibrary{\idxcode{counted_iterator}!constructor}% \begin{itemdecl} template - requires ConvertibleTo + requires convertible_to constexpr counted_iterator(const counted_iterator& x); \end{itemdecl} @@ -5193,7 +5196,7 @@ \indexlibrarymember{operator=}{counted_iterator}% \begin{itemdecl} template - requires Assignable + requires assignable_from constexpr counted_iterator& operator=(const counted_iterator& x); \end{itemdecl} @@ -5211,7 +5214,7 @@ \indexlibrarymember{base}{counted_iterator}% \begin{itemdecl} -constexpr I base() const & requires CopyConstructible; +constexpr I base() const & requires copy_constructible; \end{itemdecl} \begin{itemdescr} @@ -5256,7 +5259,7 @@ \indexlibrarymember{operator[]}{counted_iterator}% \begin{itemdecl} constexpr decltype(auto) operator[](iter_difference_t n) const - requires RandomAccessIterator; + requires random_access_iterator; \end{itemdecl} \begin{itemdescr} @@ -5308,7 +5311,7 @@ \indexlibrarymember{operator++}{counted_iterator}% \begin{itemdecl} constexpr counted_iterator operator++(int) - requires ForwardIterator; + requires forward_iterator; \end{itemdecl} \begin{itemdescr} @@ -5324,7 +5327,7 @@ \indexlibrarymember{operator{-}-}{counted_iterator}% \begin{itemdecl} constexpr counted_iterator& operator--(); - requires BidirectionalIterator + requires bidirectional_iterator \end{itemdecl} \begin{itemdescr} @@ -5340,7 +5343,7 @@ \indexlibrarymember{operator{-}-}{counted_iterator}% \begin{itemdecl} constexpr counted_iterator operator--(int) - requires BidirectionalIterator; + requires bidirectional_iterator; \end{itemdecl} \begin{itemdescr} @@ -5356,7 +5359,7 @@ \indexlibrarymember{operator+}{counted_iterator}% \begin{itemdecl} constexpr counted_iterator operator+(iter_difference_t n) const - requires RandomAccessIterator; + requires random_access_iterator; \end{itemdecl} \begin{itemdescr} @@ -5368,7 +5371,7 @@ \begin{itemdecl} friend constexpr counted_iterator operator+( iter_difference_t n, const counted_iterator& x) - requires RandomAccessIterator; + requires random_access_iterator; \end{itemdecl} \begin{itemdescr} @@ -5379,7 +5382,7 @@ \indexlibrarymember{operator+=}{counted_iterator}% \begin{itemdecl} constexpr counted_iterator& operator+=(iter_difference_t n) - requires RandomAccessIterator; + requires random_access_iterator; \end{itemdecl} \begin{itemdescr} @@ -5398,7 +5401,7 @@ \indexlibrarymember{operator-}{counted_iterator}% \begin{itemdecl} constexpr counted_iterator operator-(iter_difference_t n) const - requires RandomAccessIterator; + requires random_access_iterator; \end{itemdecl} \begin{itemdescr} @@ -5408,7 +5411,7 @@ \indexlibrarymember{operator-}{counted_iterator}% \begin{itemdecl} -template I2> +template I2> friend constexpr iter_difference_t operator-( const counted_iterator& x, const counted_iterator& y); \end{itemdecl} @@ -5449,7 +5452,7 @@ \indexlibrarymember{operator-=}{counted_iterator}% \begin{itemdecl} constexpr counted_iterator& operator-=(iter_difference_t n) - requires RandomAccessIterator; + requires random_access_iterator; \end{itemdecl} \begin{itemdescr} @@ -5469,7 +5472,7 @@ \indexlibrarymember{operator==}{counted_iterator}% \begin{itemdecl} -template I2> +template I2> friend constexpr bool operator==( const counted_iterator& x, const counted_iterator& y); \end{itemdecl} @@ -5497,7 +5500,7 @@ \indexlibrarymember{operator<=>}{counted_iterator}% \begin{itemdecl} -template I2> +template I2> friend constexpr strong_ordering operator<=>( const counted_iterator& x, const counted_iterator& y); \end{itemdecl} @@ -5526,7 +5529,7 @@ friend constexpr iter_rvalue_reference_t iter_move(const counted_iterator& i) noexcept(noexcept(ranges::iter_move(i.current))) - requires InputIterator; + requires input_iterator; \end{itemdecl} \begin{itemdescr} @@ -5536,7 +5539,7 @@ \indexlibrarymember{iter_swap}{counted_iterator}% \begin{itemdecl} -template I2> +template I2> friend constexpr void iter_swap(const counted_iterator& x, const counted_iterator& y) noexcept(noexcept(ranges::iter_swap(x.current, y.current))); @@ -5554,7 +5557,7 @@ \indexlibrary{\idxcode{unreachable_sentinel_t}}% \pnum Class \tcode{unreachable_sentinel_t} can be used with -any \libconcept{WeaklyIncrementable} type +any \libconcept{weakly_incrementable} type to denote the ``upper bound'' of an unbounded interval. \pnum @@ -5575,7 +5578,7 @@ \begin{codeblock} namespace std { struct unreachable_sentinel_t { - template + template friend constexpr bool operator==(unreachable_sentinel_t, const I&) noexcept { return false; } }; diff --git a/source/lib-intro.tex b/source/lib-intro.tex index eff21d116c..cfa259e339 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -512,7 +512,7 @@ requirement. Names in \tcode{constant width} type refer to library concepts which are presented as a concept definition\iref{temp}, possibly with additional prose semantic requirements. For example, -\libconcept{Destructible}\iref{concept.destructible} +\libconcept{destructible}\iref{concept.destructible} is such a named requirement. \pnum @@ -532,8 +532,8 @@ total functions; that is, some arguments to a required operation may result in the required semantics failing to be met. \begin{example} -The required \tcode{<} operator of the \libconcept{StrictTotallyOrdered} -concept\iref{concept.stricttotallyordered} does not meet the +The required \tcode{<} operator of the \libconcept{totally_ordered} +concept\iref{concept.totallyordered} does not meet the semantic requirements of that concept when operating on NaNs. \end{example} This does not affect whether a type models the concept. @@ -718,11 +718,11 @@ constexpr auto @\placeholdernc{synth-three-way}@ = [](const T& t, const U& u) requires requires { - { t < u } -> ConvertibleTo; - { u < t } -> ConvertibleTo; + { t < u } -> convertible_to; + { u < t } -> convertible_to; } { - if constexpr (ThreeWayComparableWith) { + if constexpr (three_way_comparable_with) { return t <=> u; } else { if (t < u) return weak_ordering::less; @@ -1011,7 +1011,7 @@ \pnum The type of a customization point object shall model -\libconcept{Semiregular}\iref{concepts.object}. +\libconcept{semiregular}\iref{concepts.object}. \pnum All instances of a specific customization point object type shall @@ -1019,7 +1019,7 @@ \pnum The type \tcode{T} of a customization point object shall model -\tcode{\libconcept{Invocable}}\iref{concept.invocable} +\tcode{\libconcept{invocable}}\iref{concept.invocable} when the types in \tcode{Args...} meet the requirements specified in that customization point object's definition. When the types of \tcode{Args...} do not meet the customization point object's requirements, \tcode{T} shall not have diff --git a/source/numerics.tex b/source/numerics.tex index 429f1d545b..0fbf13a386 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -1760,7 +1760,7 @@ namespace std { // \ref{rand.req.urng}, uniform random bit generator requirements template - concept UniformRandomBitGenerator = @\seebelow@; + concept uniform_random_bit_generator = @\seebelow@; // \ref{rand.eng.lcong}, class template \tcode{linear_congruential_engine} template @@ -2153,17 +2153,17 @@ \begin{codeblock} template - concept UniformRandomBitGenerator = - Invocable && UnsignedIntegral> && + concept uniform_random_bit_generator = + invocable && unsigned_integral> && requires { - { G::min() } -> Same>; - { G::max() } -> Same>; + { G::min() } -> same_as>; + { G::max() } -> same_as>; }; \end{codeblock} \pnum Let \tcode{g} be an object of type \tcode{G}. \tcode{G} models -\libconcept{UniformRandomBitGenerator} only if +\libconcept{uniform_random_bit_generator} only if \begin{itemize} \item both \tcode{G::min()} and \tcode{G::max()} are constant @@ -2178,7 +2178,7 @@ \indextext{uniform random bit generator!requirements|)}% \pnum A class \tcode{G} meets the \term{uniform random bit generator} requirements if -\tcode{G} models \libconcept{UniformRandomBitGenerator}, +\tcode{G} models \libconcept{uniform_random_bit_generator}, \tcode{invoke_result_t} is an unsigned integer type\iref{basic.fundamental}, and \tcode{G} provides a nested \grammarterm{typedef-name} \tcode{result_type} @@ -8715,12 +8715,12 @@ In the \tcode{begin} and \tcode{end} function templates that follow, \unspec{1} is a type that meets the requirements of a mutable \oldconcept{RandomAccessIterator}\iref{random.access.iterators} -and models \libconcept{ContiguousIterator}\iref{iterator.concept.contiguous}, +and models \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous}, whose \tcode{value_type} is the template parameter \tcode{T} and whose \tcode{reference} type is \tcode{T\&}. \unspec{2} is a type that meets the requirements of a constant \oldconcept{RandomAccessIterator} -and models \libconcept{ContiguousIterator}, +and models \libconcept{contiguous_iterator}, whose \tcode{value_type} is the template parameter \tcode{T} and whose \tcode{reference} type is \tcode{const T\&}. @@ -10484,19 +10484,19 @@ template inline constexpr T egamma_v = @\unspec@; template inline constexpr T phi_v = @\unspec@; - template inline constexpr T e_v = @\seebelow@; - template inline constexpr T log2e_v = @\seebelow@; - template inline constexpr T log10e_v = @\seebelow@; - template inline constexpr T pi_v = @\seebelow@; - template inline constexpr T inv_pi_v = @\seebelow@; - template inline constexpr T inv_sqrtpi_v = @\seebelow@; - template inline constexpr T ln2_v = @\seebelow@; - template inline constexpr T ln10_v = @\seebelow@; - template inline constexpr T sqrt2_v = @\seebelow@; - template inline constexpr T sqrt3_v = @\seebelow@; - template inline constexpr T inv_sqrt3_v = @\seebelow@; - template inline constexpr T egamma_v = @\seebelow@; - template inline constexpr T phi_v = @\seebelow@; + template inline constexpr T e_v = @\seebelow@; + template inline constexpr T log2e_v = @\seebelow@; + template inline constexpr T log10e_v = @\seebelow@; + template inline constexpr T pi_v = @\seebelow@; + template inline constexpr T inv_pi_v = @\seebelow@; + template inline constexpr T inv_sqrtpi_v = @\seebelow@; + template inline constexpr T ln2_v = @\seebelow@; + template inline constexpr T ln10_v = @\seebelow@; + template inline constexpr T sqrt2_v = @\seebelow@; + template inline constexpr T sqrt3_v = @\seebelow@; + template inline constexpr T inv_sqrt3_v = @\seebelow@; + template inline constexpr T egamma_v = @\seebelow@; + template inline constexpr T phi_v = @\seebelow@; inline constexpr double e = e_v; inline constexpr double log2e = log2e_v; diff --git a/source/overloading.tex b/source/overloading.tex index b572b551c5..f8a1c78a31 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -1749,7 +1749,7 @@ C(T, U) -> C>; // \#2 template using A = C; -template using B = A; +template using B = A; int i{}; double d{}; @@ -1791,11 +1791,11 @@ template concept deduces_B = requires { sizeof(BB); }; // The guides for \tcode{B} derived from the above \tcode{f1'} and \tcode{f2'} for \tcode{A} are as follows: -template +template requires deduces_A> && deduces_B> auto f1_prime_for_B(W *, W *) -> C; -template +template requires deduces_A>> && deduces_B>> auto f2_prime_for_B(W *, U) -> C>; diff --git a/source/ranges.tex b/source/ranges.tex index a5d58c326d..b17370029b 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -48,19 +48,19 @@ // \ref{range.range}, ranges template - concept Range = @\seebelow@; + concept range = @\seebelow@; - template + template using iterator_t = decltype(ranges::begin(declval())); - template + template using sentinel_t = decltype(ranges::end(declval())); - template + template using range_difference_t = iter_difference_t>; - template + template using range_value_t = iter_value_t>; - template + template using range_reference_t = iter_reference_t>; - template + template using range_rvalue_reference_t = iter_rvalue_reference_t>; // \ref{range.sized}, sized ranges @@ -68,7 +68,7 @@ inline constexpr bool disable_sized_range = false; template - concept SizedRange = @\seebelow@; + concept sized_range = @\seebelow@; // \ref{range.view}, views template @@ -77,52 +77,52 @@ struct view_base { }; template - concept View = @\seebelow@; + concept view = @\seebelow@; // \ref{range.refinements}, other range refinements template - concept OutputRange = @\seebelow@; + concept output_range = @\seebelow@; template - concept InputRange = @\seebelow@; + concept input_range = @\seebelow@; template - concept ForwardRange = @\seebelow@; + concept forward_range = @\seebelow@; template - concept BidirectionalRange = @\seebelow@; + concept bidirectional_range = @\seebelow@; template - concept RandomAccessRange = @\seebelow@; + concept random_access_range = @\seebelow@; template - concept ContiguousRange = @\seebelow@; + concept contiguous_range = @\seebelow@; template - concept CommonRange = @\seebelow@; + concept common_range = @\seebelow@; template - concept ViewableRange = @\seebelow@; + concept viewable_range = @\seebelow@; // \ref{view.interface}, class template \tcode{view_interface} template - requires is_class_v && Same> + requires is_class_v && same_as> class view_interface; // \ref{range.subrange}, sub-ranges enum class subrange_kind : bool { unsized, sized }; - template S = I, subrange_kind K = @\seebelow@> - requires (K == subrange_kind::sized || !SizedSentinel) + template S = I, subrange_kind K = @\seebelow@> + requires (K == subrange_kind::sized || !sized_sentinel_for) class subrange; // \ref{range.dangling}, dangling iterator handling struct dangling; - template + template using safe_iterator_t = conditional_t<@\placeholder{forwarding-range}@, iterator_t, dangling>; - template + template using safe_subrange_t = conditional_t<@\placeholder{forwarding-range}@, subrange>, dangling>; @@ -131,124 +131,124 @@ requires is_object_v class empty_view; - namespace view { + namespace views { template inline constexpr empty_view empty{}; } // \ref{range.single}, single view - template + template requires is_object_v class single_view; - namespace view { inline constexpr @\unspec@ single = @\unspec@; } + namespace views { inline constexpr @\unspec@ single = @\unspec@; } // \ref{range.iota}, iota view - template + template requires @\placeholder{weakly-equality-comparable-with}@ class iota_view; - namespace view { inline constexpr @\unspec@ iota = @\unspec@; } + namespace views { inline constexpr @\unspec@ iota = @\unspec@; } // \ref{range.all}, all view - namespace view { inline constexpr @\unspec@ all = @\unspec@; } + namespace views { inline constexpr @\unspec@ all = @\unspec@; } - template - using all_view = decltype(view::all(declval())); + template + using all_view = decltype(views::all(declval())); - template + template requires is_object_v class ref_view; // \ref{range.filter}, filter view - template> Pred> - requires View && is_object_v + template> Pred> + requires view && is_object_v class filter_view; - namespace view { inline constexpr @\unspec@ filter = @\unspec@; } + namespace views { inline constexpr @\unspec@ filter = @\unspec@; } // \ref{range.transform}, transform view - template - requires View && is_object_v && - RegularInvocable> + template + requires view && is_object_v && + regular_invocable> class transform_view; - namespace view { inline constexpr @\unspec@ transform = @\unspec@; } + namespace views { inline constexpr @\unspec@ transform = @\unspec@; } // \ref{range.take}, take view - template class take_view; + template class take_view; - namespace view { inline constexpr @\unspec@ take = @\unspec@; } + namespace views { inline constexpr @\unspec@ take = @\unspec@; } // \ref{range.take.while}, take while view - template - requires InputRange && is_object_v && - IndirectUnaryPredicate> + template + requires input_range && is_object_v && + indirect_unary_predicate> class take_while_view; - namespace view { inline constexpr @\unspec@ take_while = @\unspec@; } + namespace views { inline constexpr @\unspec@ take_while = @\unspec@; } // \ref{range.drop}, drop view - template + template class drop_view; - namespace view { inline constexpr @\unspec@ drop = @\unspec@; } + namespace views { inline constexpr @\unspec@ drop = @\unspec@; } // \ref{range.drop.while}, drop while view - template - requires InputRange && is_object_v && - IndirectUnaryPredicate> + template + requires input_range && is_object_v && + indirect_unary_predicate> class drop_while_view; - namespace view { inline constexpr @\unspec@ drop_while = @\unspec@; } + namespace views { inline constexpr @\unspec@ drop_while = @\unspec@; } // \ref{range.join}, join view - template - requires View && InputRange> && + template + requires view && input_range> && (is_reference_v> || - View>) + view>) class join_view; - namespace view { inline constexpr @\unspec@ join = @\unspec@; } + namespace views { inline constexpr @\unspec@ join = @\unspec@; } // \ref{range.split}, split view template concept @\placeholder{tiny-range}@ = @\seebelow@; // \expos - template - requires View && View && - IndirectlyComparable, iterator_t, ranges::equal_to> && - (ForwardRange || @\placeholder{tiny-range}@) + template + requires view && view && + indirectly_comparable, iterator_t, ranges::equal_to> && + (forward_range || @\placeholder{tiny-range}@) class split_view; - namespace view { inline constexpr @\unspec@ split = @\unspec@; } + namespace views { inline constexpr @\unspec@ split = @\unspec@; } // \ref{range.counted}, counted view - namespace view { inline constexpr @\unspec@ counted = @\unspec@; } + namespace views { inline constexpr @\unspec@ counted = @\unspec@; } // \ref{range.common}, common view - template - requires (!CommonRange) + template + requires (!common_range) class common_view; - namespace view { inline constexpr @\unspec@ common = @\unspec@; } + namespace views { inline constexpr @\unspec@ common = @\unspec@; } // \ref{range.reverse}, reverse view - template - requires BidirectionalRange + template + requires bidirectional_range class reverse_view; - namespace view { inline constexpr @\unspec@ reverse = @\unspec@; } + namespace views { inline constexpr @\unspec@ reverse = @\unspec@; } // \ref{range.istream}, istream view - template> + template> requires @\seebelow@ class basic_istream_view; template basic_istream_view istream_view(basic_istream& s); // \ref{range.elements}, elements view - template + template requires @\seebelow@; class elements_view; @@ -257,7 +257,7 @@ template using values_view = elements_view, 1>; - namespace view { + namespace views { template inline constexpr @\unspec@ elements = @\unspec@ ; inline constexpr @\unspec@ keys = @\unspec@ ; @@ -266,7 +266,7 @@ } namespace std { - namespace view = ranges::view; + namespace views = ranges::views; template struct tuple_size> @@ -317,11 +317,11 @@ \item Otherwise, if \tcode{E} is an lvalue, \tcode{\placeholdernc{decay-copy}(E.begin())} - if it is a valid expression and its type \tcode{I} models \tcode{Iterator}. + if it is a valid expression and its type \tcode{I} models \tcode{input_or_output_iterator}. \item Otherwise, \tcode{\placeholdernc{decay-copy}(begin(E))} if it is a - valid expression and its type \tcode{I} models \tcode{Iterator} with overload + valid expression and its type \tcode{I} models \tcode{input_or_output_iterator} with overload resolution performed in a context that includes the declarations: \begin{codeblock} template void begin(T&&) = delete; @@ -341,7 +341,7 @@ \pnum \begin{note} Whenever \tcode{ranges::begin(E)} is a valid expression, its type models -\tcode{Iterator}. +\tcode{input_or_output_iterator}. \end{note} \rSec2[range.access.end]{\tcode{ranges::end}} @@ -360,12 +360,17 @@ Otherwise, if \tcode{E} is an lvalue, \tcode{\placeholdernc{decay-copy}(E.end())} if it is a valid expression and its type \tcode{S} models - \tcode{Sentinel}. + \begin{codeblock} + sentinel_for + \end{codeblock} \item Otherwise, \tcode{\placeholdernc{decay-copy}(end(E))} if it is a valid expression and its type \tcode{S} models - \tcode{Sentinel} with overload + \begin{codeblock} + sentinel_for + \end{codeblock} + with overload resolution performed in a context that includes the declarations: \begin{codeblock} template void end(T&&) = delete; @@ -387,7 +392,7 @@ Whenever \tcode{ranges::end(E)} is a valid expression, the types \tcode{S} and \tcode{I} of \tcode{ranges::end(E)} and \tcode{ranges::begin(E)} -model \libconcept{Sentinel}. +model \tcode{\libconcept{sentinel_for}}. \end{note} \rSec2[range.access.cbegin]{\tcode{ranges::cbegin}} @@ -404,7 +409,7 @@ \pnum \begin{note} Whenever \tcode{ranges::cbegin(E)} is a valid expression, its type models -\tcode{Iterator}. +\tcode{input_or_output_iterator}. \end{note} \rSec2[range.access.cend]{\tcode{ranges::cend}} @@ -424,7 +429,7 @@ Whenever \tcode{ranges::cend(E)} is a valid expression, the types \tcode{S} and \tcode{I} of \tcode{ranges::cend(E)} and \tcode{ranges::cbegin(E)} -model \libconcept{Sentinel}. +model \tcode{\libconcept{sentinel_for}}. \end{note} \rSec2[range.access.rbegin]{\tcode{ranges::rbegin}} @@ -437,11 +442,11 @@ \begin{itemize} \item If \tcode{E} is an lvalue, \tcode{\placeholdernc{decay-copy}(E.rbegin())} - if it is a valid expression and its type \tcode{I} models \tcode{Iterator}. + if it is a valid expression and its type \tcode{I} models \tcode{input_or_output_iterator}. \item Otherwise, \tcode{\placeholdernc{decay-copy}(rbegin(E))} if it is a valid - expression and its type \tcode{I} models \tcode{Iterator} with overload + expression and its type \tcode{I} models \tcode{input_or_output_iterator} with overload resolution performed in a context that includes the declaration: \begin{codeblock} template void rbegin(T&&) = delete; @@ -453,7 +458,7 @@ Otherwise, \tcode{make_reverse_iterator(ranges::end(E))} if both \tcode{ranges::begin(E)} and \tcode{ranges::end(\brk{}E)} are valid expressions of the same type \tcode{I} which models - \libconcept{BidirectionalIterator}\iref{iterator.concept.bidir}. + \libconcept{bidirectional_iterator}\iref{iterator.concept.bidir}. \item Otherwise, \tcode{ranges::rbegin(E)} is ill-formed. @@ -466,7 +471,7 @@ \pnum \begin{note} Whenever \tcode{ranges::rbegin(E)} is a valid expression, its type models -\tcode{Iterator}. +\tcode{input_or_output_iterator}. \end{note} \rSec2[range.access.rend]{\tcode{ranges::rend}} @@ -480,12 +485,17 @@ \item If \tcode{E} is an lvalue, \tcode{\placeholdernc{decay-copy}(E.rend())} if it is a valid expression and its type \tcode{S} models - \tcode{Sentinel<\brk{}decltype(ranges::rbegin(E))>}. + \begin{codeblock} + sentinel_for + \end{codeblock} \item Otherwise, \tcode{\placeholdernc{decay-copy}(rend(E))} if it is a valid expression and its type \tcode{S} models - \tcode{Sentinel} with overload + \begin{codeblock} + sentinel_for + \end{codeblock} + with overload resolution performed in a context that includes the declaration: \begin{codeblock} template void rend(T&&) = delete; @@ -497,7 +507,7 @@ Otherwise, \tcode{make_reverse_iterator(ranges::begin(E))} if both \tcode{ranges::begin(E)} and \tcode{ranges::\brk{}end(E)} are valid expressions of the same type \tcode{I} which models - \tcode{BidirectionalIterator}\iref{iterator.concept.bidir}. + \libconcept{bidirectional_iterator}\iref{iterator.concept.bidir}. \item Otherwise, \tcode{ranges::rend(E)} is ill-formed. @@ -512,7 +522,7 @@ Whenever \tcode{ranges::rend(E)} is a valid expression, the types \tcode{S} and \tcode{I} of \tcode{ranges::rend(E)} and \tcode{ranges::rbegin(E)} -model \libconcept{Sentinel}. +model \tcode{\libconcept{sentinel_for}}. \end{note} \rSec2[range.access.crbegin]{\tcode{ranges::crbegin}} @@ -530,7 +540,7 @@ \pnum \begin{note} Whenever \tcode{ranges::crbegin(E)} is a valid expression, its -type models \tcode{Iterator}. +type models \tcode{input_or_output_iterator}. \end{note} \rSec2[range.access.crend]{\tcode{ranges::crend}} @@ -550,7 +560,7 @@ Whenever \tcode{ranges::crend(E)} is a valid expression, the types \tcode{S} and \tcode{I} of \tcode{ranges::crend(E)} and \tcode{ranges::crbegin(E)} -model \libconcept{Sentinel}. +model \tcode{\libconcept{sentinel_for}}. \end{note} \rSec2[range.prim.size]{\tcode{ranges::size}} @@ -592,9 +602,9 @@ Otherwise, \tcode{\placeholdernc{make-unsigned-like}(ranges::end(E) - ranges::begin(E))}\iref{range.subrange} if it is a valid expression and the types \tcode{I} and \tcode{S} of \tcode{ranges::begin(E)} and - \tcode{ranges::end(E)} (respectively) model both\hfill\break %avoid overfull - \tcode{SizedSentinel}\iref{iterator.concept.sizedsentinel} and - \tcode{Forward\-Iterator}. + \tcode{ranges::end(E)} (respectively) model both + \tcode{\libconcept{sized_sentinel_for}}\iref{iterator.concept.sizedsentinel} and + \tcode{\libconcept{forward_iterator}}. However, \tcode{E} is evaluated only once. \item @@ -630,7 +640,7 @@ \tcode{bool(ranges::begin(E) == ranges::end(E))} except that \tcode{E} is only evaluated once, if \tcode{EQ} is a valid expression and - the type of \tcode{ranges::begin(E)} models \libconcept{ForwardIterator}. + the type of \tcode{ranges::begin(E)} models \libconcept{forward_iterator}. \item Otherwise, \tcode{ranges::empty(E)} is ill-formed. @@ -660,7 +670,7 @@ \item Otherwise, if \tcode{ranges::begin(E)} is a valid expression whose type models - \tcode{ContiguousIterator}, + \tcode{contiguous_iterator}, \tcode{to_address(ranges::begin(E))}. \item @@ -703,33 +713,33 @@ Ranges are an abstraction that allow a \Cpp{} program to operate on elements of data structures uniformly. Calling \tcode{ranges::begin} on a range returns an object -whose type models \libconcept{Iterator}\iref{iterator.concept.iterator}. +whose type models \libconcept{input_or_output_iterator}\iref{iterator.concept.iterator}. Calling \tcode{ranges::end} on a range returns an object whose type \tcode{S}, together with the type \tcode{I} of the object returned by \tcode{ranges::begin}, -models \libconcept{Sentinel}. +models \tcode{\libconcept{sentinel_for}}. The library formalizes the interfaces, semantics, and complexity of ranges to enable algorithms and range adaptors that work efficiently on different types of sequences. \pnum -The \libconcept{Range} concept requires that +The \libconcept{range} concept requires that \tcode{ranges::begin} and \tcode{ranges::end} return an iterator and a sentinel, respectively. -The \libconcept{SizedRange} concept refines \libconcept{Range} with +The \libconcept{sized_range} concept refines \libconcept{range} with the requirement that the number of elements in the range can be determined in constant time using the \tcode{ranges::size} function. -The \tcode{View} concept specifies requirements on a \libconcept{Range} type +The \libconcept{view} concept specifies requirements on a \libconcept{range} type with constant-time copy and assign operations. \pnum -Several refinements of \libconcept{Range} group requirements +Several refinements of \libconcept{range} group requirements that arise frequently in concepts and algorithms. Common ranges are ranges for which \tcode{ranges::begin} and \tcode{ranges::end} return objects of the same type. Random access ranges are ranges for which \tcode{ranges::begin} returns a type that models -\libconcept{RandomAccessIterator}\iref{iterator.concept.random.access}. +\libconcept{random_access_iterator}\iref{iterator.concept.random.access}. (Contiguous, bidirectional, forward, input, and output ranges are defined similarly.) Viewable ranges can be converted to views. @@ -737,11 +747,11 @@ \rSec2[range.range]{Ranges} \pnum -The \libconcept{Range} concept defines the requirements of a type that allows +The \libconcept{range} concept defines the requirements of a type that allows iteration over its elements by providing an iterator and sentinel that denote the elements of the range. -\indexlibrary{\idxcode{Range}}% +\indexlibrary{\idxcode{range}}% \begin{itemdecl} template concept @\placeholder{range-impl}@ = // \expos @@ -751,11 +761,11 @@ }; template - concept Range = @\placeholdernc{range-impl}@; + concept range = @\placeholdernc{range-impl}@; template concept @\placeholder{forwarding-range}@ = // \expos - Range && @\placeholder{range-impl}@; + range && @\placeholder{range-impl}@; \end{itemdecl} \begin{itemdescr} @@ -782,18 +792,18 @@ are amortized constant time and non-modifying, and \item if the type of \tcode{ranges::begin(E)} models -\libconcept{ForwardIterator}, \tcode{ranges::begin(E)} is equality-preserving. +\libconcept{forward_iterator}, \tcode{ranges::begin(E)} is equality-preserving. \end{itemize} \pnum \begin{note} Equality preservation of both \tcode{ranges::begin} and -\tcode{ranges::end} enables passing a \libconcept{Range} whose iterator -type models \libconcept{ForwardIterator} to multiple +\tcode{ranges::end} enables passing a \libconcept{range} whose iterator +type models \libconcept{forward_iterator} to multiple algorithms and making multiple passes over the range by repeated calls to \tcode{ranges::begin} and \tcode{ranges::end}. Since \tcode{ranges::begin} is not required to be equality-preserving -when the return type does not model \libconcept{ForwardIterator}, repeated calls +when the return type does not model \libconcept{forward_iterator}, repeated calls might not return equal values or might not be well-defined; \tcode{ranges::begin} should be called at most once for such a range. \end{note} @@ -833,15 +843,15 @@ \rSec2[range.sized]{Sized ranges} \pnum -The \libconcept{SizedRange} concept specifies the requirements -of a \libconcept{Range} type that knows its size in constant time with the +The \libconcept{sized_range} concept specifies the requirements +of a \libconcept{range} type that knows its size in constant time with the \tcode{size} function. -\indexlibrary{\idxcode{SizedRange}}% +\indexlibrary{\idxcode{sized_range}}% \begin{itemdecl} template - concept SizedRange = - Range && + concept sized_range = + range && !disable_sized_range> && requires(T& t) { ranges::size(t); }; \end{itemdecl} @@ -849,21 +859,21 @@ \begin{itemdescr} \pnum Given an lvalue \tcode{t} of type \tcode{remove_reference_t}, \tcode{T} -models \libconcept{SizedRange} only if +models \libconcept{sized_range} only if \begin{itemize} \item \tcode{ranges::size(t)} is \bigoh{1}, does not modify \tcode{t}, and is equal to \tcode{ranges::distance(t)}, and -\item if \tcode{iterator_t} models \libconcept{ForwardIterator}, +\item if \tcode{iterator_t} models \libconcept{forward_iterator}, \tcode{ranges::size(t)} is well-defined regardless of the evaluation of \tcode{ranges::begin(t)}. \begin{note} \tcode{ranges::size(t)} is otherwise not required to be well-defined after evaluating \tcode{ranges::begin(t)}. For example, \tcode{ranges::size(t)} might be well-defined -for a \libconcept{SizedRange} whose iterator type -does not model \libconcept{ForwardIterator} +for a \libconcept{sized_range} whose iterator type +does not model \libconcept{forward_iterator} only if evaluated before the first call to \tcode{ranges::begin(t)}. \end{note} \end{itemize} @@ -872,7 +882,7 @@ \begin{note} The complexity requirement for the evaluation of \tcode{ranges::size} is non-amortized, unlike the case for the complexity of the evaluations of -\tcode{ranges::begin} and \tcode{ranges::end} in the \tcode{Range} concept. +\tcode{ranges::begin} and \tcode{ranges::end} in the \libconcept{range} concept. \end{note} \end{itemdescr} @@ -895,38 +905,38 @@ \pnum \begin{note} \tcode{disable_sized_range} allows use of range types with the library -that satisfy but do not in fact model \libconcept{SizedRange}. +that satisfy but do not in fact model \libconcept{sized_range}. \end{note} \end{itemdescr} \rSec2[range.view]{Views} -\indexlibrary{\idxcode{View}}% +\indexlibrary{\idxcode{view}}% \begin{itemdecl} template - concept View = - Range && Semiregular && enable_view; + concept view = + range && semiregular && enable_view; \end{itemdecl} \begin{itemdescr} -% FIXME: This should explicitly say when View is modeled. +% FIXME: This should explicitly say when view is modeled. \pnum -The \tcode{View} concept specifies the requirements of a \libconcept{Range} type +The \libconcept{view} concept specifies the requirements of a \libconcept{range} type that has constant time copy, move, and assignment operators; that is, the cost of these operations is not proportional to the number of elements in the -\tcode{View}. +\tcode{view}. \pnum \begin{example} -Examples of \tcode{View}s are: +Examples of \tcode{view}s are: \begin{itemize} -\item A \libconcept{Range} type that wraps a pair of iterators. +\item A \libconcept{range} type that wraps a pair of iterators. -\item A \libconcept{Range} type that holds its elements by \tcode{shared_ptr} +\item A \libconcept{range} type that holds its elements by \tcode{shared_ptr} and shares ownership with all its copies. -\item A \libconcept{Range} type that generates its elements on demand. +\item A \libconcept{range} type that generates its elements on demand. \end{itemize} Most containers\iref{containers} are not views since @@ -936,7 +946,7 @@ \end{itemdescr} \pnum -Since the difference between \libconcept{Range} and \libconcept{View} is largely +Since the difference between \libconcept{range} and \libconcept{view} is largely semantic, the two are differentiated with the help of \tcode{enable_view}. \indexlibrary{\idxcode{enable_view}}% @@ -951,7 +961,7 @@ For a type \tcode{T}, the default value of \tcode{enable_view} is: \begin{itemize} -\item If \tcode{DerivedFrom} is \tcode{true}, \tcode{true}. +\item If \tcode{derived_from} is \tcode{true}, \tcode{true}. \item Otherwise, if \tcode{T} is a specialization of class template \tcode{initializer_list}\iref{support.initlist}, \tcode{set}\iref{set}, @@ -959,7 +969,7 @@ \tcode{unordered_set}\iref{unord.set}, \tcode{unordered_multiset}\iref{unord.multiset}, or \tcode{match_results}\iref{re.results}, \tcode{false}. -\item Otherwise, if both \tcode{T} and \tcode{const T} model \libconcept{Range} +\item Otherwise, if both \tcode{T} and \tcode{const T} model \libconcept{range} and \tcode{range_reference_t} is not the same type as \tcode{range_reference_t}, \tcode{false}. @@ -973,7 +983,7 @@ \pnum Pursuant to \ref{namespace.std}, users may specialize \tcode{enable_view} to \tcode{true} -for cv-unqualified program-defined types which model \libconcept{View}, +for cv-unqualified program-defined types which model \libconcept{view}, and \tcode{false} for types which do not. Such specializations shall be usable in constant expressions\iref{expr.const} and @@ -983,78 +993,78 @@ \rSec2[range.refinements]{Other range refinements} \pnum -The \tcode{OutputRange} concept specifies requirements of a -\libconcept{Range} type for which \tcode{ranges::begin} returns -a model of \tcode{OutputIterator}\iref{iterator.concept.output}. -\tcode{InputRange}, \tcode{ForwardRange}, \tcode{BidirectionalRange}, -and \tcode{RandomAccessRange} are defined similarly. +The \libconcept{output_range} concept specifies requirements of a +\libconcept{range} type for which \tcode{ranges::begin} returns +a model of \libconcept{output_iterator}\iref{iterator.concept.output}. +\libconcept{input_range}, \libconcept{forward_range}, \libconcept{bidirectional_range}, +and \libconcept{random_access_range} are defined similarly. -\indexlibrary{\idxcode{OutputRange}}% -\indexlibrary{\idxcode{InputRange}}% -\indexlibrary{\idxcode{ForwardRange}}% -\indexlibrary{\idxcode{BidirectionalRange}}% -\indexlibrary{\idxcode{RandomAccessRange}}% +\indexlibrary{\idxcode{output_range}}% +\indexlibrary{\idxcode{input_range}}% +\indexlibrary{\idxcode{forward_range}}% +\indexlibrary{\idxcode{bidirectional_range}}% +\indexlibrary{\idxcode{random_access_range}}% \begin{itemdecl} template - concept OutputRange = - Range && OutputIterator, T>; + concept output_range = + range && output_iterator, T>; template - concept InputRange = - Range && InputIterator>; + concept input_range = + range && input_iterator>; template - concept ForwardRange = - InputRange && ForwardIterator>; + concept forward_range = + input_range && forward_iterator>; template - concept BidirectionalRange = - ForwardRange && BidirectionalIterator>; + concept bidirectional_range = + forward_range && bidirectional_iterator>; template - concept RandomAccessRange = - BidirectionalRange && RandomAccessIterator>; + concept random_access_range = + bidirectional_range && random_access_iterator>; \end{itemdecl} \pnum -\tcode{ContiguousRange} additionally requires that +\tcode{contiguous_range} additionally requires that the \tcode{ranges::data} customization point\iref{range.prim.data} is usable with the range. -\indexlibrary{\idxcode{ContiguousRange}}% +\indexlibrary{\idxcode{contiguous_range}}% \begin{itemdecl} template - concept ContiguousRange = - RandomAccessRange && ContiguousIterator> && + concept contiguous_range = + random_access_range && contiguous_iterator> && requires(T& t) { - { ranges::data(t) } -> Same>>; + { ranges::data(t) } -> same_as>>; }; \end{itemdecl} \pnum -The \tcode{CommonRange} concept specifies requirements of -a \libconcept{Range} type for which \tcode{ranges::begin} and +The \libconcept{common_range} concept specifies requirements of +a \libconcept{range} type for which \tcode{ranges::begin} and \tcode{ranges::end} return objects of the same type. \begin{example} -The standard containers\iref{containers} model \tcode{CommonRange}. +The standard containers\iref{containers} model \libconcept{common_range}. \end{example} -\indexlibrary{\idxcode{CommonRange}}% +\indexlibrary{\idxcode{common_range}}% \begin{itemdecl} template - concept CommonRange = - Range && Same, sentinel_t>; + concept common_range = + range && same_as, sentinel_t>; \end{itemdecl} \pnum -The \libconcept{ViewableRange} concept specifies the requirements of a -\libconcept{Range} type that can be converted to a \libconcept{View} safely. +The \libconcept{viewable_range} concept specifies the requirements of a +\libconcept{range} type that can be converted to a \libconcept{view} safely. -\indexlibrary{\idxcode{ViewableRange}}% +\indexlibrary{\idxcode{viewable_range}}% \begin{itemdecl} template - concept ViewableRange = - Range && (@\placeholder{forwarding-range}@ || View>); + concept viewable_range = + range && (@\placeholder{forwarding-range}@ || view>); \end{itemdecl} \rSec1[range.utility]{Range utilities} @@ -1072,31 +1082,31 @@ \begin{codeblock} template concept @\placeholder{simple-view}@ = // \expos - View && Range && - Same, iterator_t> && - Same, sentinel_t>; + view && range && + same_as, iterator_t> && + same_as, sentinel_t>; -template +template concept @\placeholder{has-arrow}@ = // \expos is_pointer_v || requires(I i) { i.operator->(); }; template concept @\placeholder{not-same-as}@ = // \expos - !Same, remove_cvref_t>; + !same_as, remove_cvref_t>; \end{codeblock} \rSec2[view.interface]{View interface} \pnum The class template \tcode{view_interface} is a helper for defining -\tcode{View}-like types that offer a container-like interface. It is +\tcode{view}-like types that offer a container-like interface. It is parameterized with the type that is derived from it. \indexlibrary{\idxcode{view_interface}}% \begin{codeblock} namespace std::ranges { template - requires is_class_v && Same> + requires is_class_v && same_as> class view_interface : public view_base { private: constexpr D& derived() noexcept { // \expos @@ -1106,10 +1116,10 @@ return static_cast(*this); } public: - constexpr bool empty() requires ForwardRange { + constexpr bool empty() requires forward_range { return ranges::begin(derived()) == ranges::end(derived()); } - constexpr bool empty() const requires ForwardRange { + constexpr bool empty() const requires forward_range { return ranges::begin(derived()) == ranges::end(derived()); } @@ -1122,35 +1132,35 @@ return !ranges::empty(derived()); } - constexpr auto data() requires ContiguousIterator> { + constexpr auto data() requires contiguous_iterator> { return to_address(ranges::begin(derived())); } constexpr auto data() const - requires Range && ContiguousIterator> { + requires range && contiguous_iterator> { return to_address(ranges::begin(derived())); } - constexpr auto size() requires ForwardRange && - SizedSentinel, iterator_t> { + constexpr auto size() requires forward_range && + sized_sentinel_for, iterator_t> { return ranges::end(derived()) - ranges::begin(derived()); } - constexpr auto size() const requires ForwardRange && - SizedSentinel, iterator_t> { + constexpr auto size() const requires forward_range && + sized_sentinel_for, iterator_t> { return ranges::end(derived()) - ranges::begin(derived()); } - constexpr decltype(auto) front() requires ForwardRange; - constexpr decltype(auto) front() const requires ForwardRange; + constexpr decltype(auto) front() requires forward_range; + constexpr decltype(auto) front() const requires forward_range; - constexpr decltype(auto) back() requires BidirectionalRange && CommonRange; + constexpr decltype(auto) back() requires bidirectional_range && common_range; constexpr decltype(auto) back() const - requires BidirectionalRange && CommonRange; + requires bidirectional_range && common_range; - template + template constexpr decltype(auto) operator[](range_difference_t n) { return ranges::begin(derived())[n]; } - template + template constexpr decltype(auto) operator[](range_difference_t n) const { return ranges::begin(derived())[n]; } @@ -1163,14 +1173,14 @@ incomplete type. Before any member of the resulting specialization of \tcode{view_interface} other than special member functions is referenced, \tcode{D} shall be complete, and -model both \libconcept{DerivedFrom>} and \libconcept{View}. +model both \tcode{\libconcept{derived_from}>} and \libconcept{view}. \rSec3[view.interface.members]{Members} \indexlibrary{\idxcode{view_interface}!\idxcode{front}}% \begin{itemdecl} -constexpr decltype(auto) front() requires ForwardRange; -constexpr decltype(auto) front() const requires ForwardRange; +constexpr decltype(auto) front() requires forward_range; +constexpr decltype(auto) front() const requires forward_range; \end{itemdecl} \begin{itemdescr} @@ -1183,9 +1193,9 @@ \indexlibrary{\idxcode{view_interface}!\idxcode{back}}% \begin{itemdecl} -constexpr decltype(auto) back() requires BidirectionalRange && CommonRange; +constexpr decltype(auto) back() requires bidirectional_range && common_range; constexpr decltype(auto) back() const - requires BidirectionalRange && CommonRange; + requires bidirectional_range && common_range; \end{itemdecl} \begin{itemdescr} @@ -1201,8 +1211,8 @@ \pnum The \tcode{subrange} class template combines together an iterator and a sentinel into a single object that models the -\libconcept{View} concept. Additionally, it models the -\libconcept{SizedRange} concept when the final template parameter is +\libconcept{view} concept. Additionally, it models the +\libconcept{sized_range} concept when the final template parameter is \tcode{subrange_kind::sized}. \indexlibrary{\idxcode{subrange}}% @@ -1212,37 +1222,37 @@ concept @\placeholdernc{pair-like}@ = // \expos !is_reference_v && requires(T t) { typename tuple_size::type; // ensures \tcode{tuple_size} is complete - requires DerivedFrom, integral_constant>; + requires derived_from, integral_constant>; typename tuple_element_t<0, remove_const_t>; typename tuple_element_t<1, remove_const_t>; - { get<0>(t) } -> ConvertibleTo&>; - { get<1>(t) } -> ConvertibleTo&>; + { get<0>(t) } -> convertible_to&>; + { get<1>(t) } -> convertible_to&>; }; template concept @\placeholdernc{pair-like-convertible-to}@ = // \expos - !Range && @\placeholder{pair-like}@> && + !range && @\placeholder{pair-like}@> && requires(T&& t) { - { get<0>(std::forward(t)) } -> ConvertibleTo; - { get<1>(std::forward(t)) } -> ConvertibleTo; + { get<0>(std::forward(t)) } -> convertible_to; + { get<1>(std::forward(t)) } -> convertible_to; }; template concept @\placeholdernc{pair-like-convertible-from}@ = // \expos - !Range && @\placeholdernc{pair-like}@ && Constructible; + !range && @\placeholdernc{pair-like}@ && constructible_from; template concept @\placeholdernc{iterator-sentinel-pair}@ = // \expos - !Range && @\placeholdernc{pair-like}@ && - Sentinel, tuple_element_t<0, T>>; + !range && @\placeholdernc{pair-like}@ && + sentinel_for, tuple_element_t<0, T>>; - template S = I, subrange_kind K = - SizedSentinel ? subrange_kind::sized : subrange_kind::unsized> - requires (K == subrange_kind::sized || !SizedSentinel) + template S = I, subrange_kind K = + sized_sentinel_for ? subrange_kind::sized : subrange_kind::unsized> + requires (K == subrange_kind::sized || !sized_sentinel_for) class subrange : public view_interface> { private: static constexpr bool StoreSize = // \expos - K == subrange_kind::sized && !SizedSentinel; + K == subrange_kind::sized && !sized_sentinel_for; I begin_ = I(); // \expos S end_ = S(); // \expos @\placeholdernc{make-unsigned-like-t}@(iter_difference_t) size_ = 0; // \expos; present only @@ -1257,11 +1267,11 @@ template<@\placeholdernc{not-same-as}@ R> requires @\placeholdernc{forwarding-range}@ && - ConvertibleTo, I> && ConvertibleTo, S> - constexpr subrange(R&& r) requires (!StoreSize || SizedRange); + convertible_to, I> && convertible_to, S> + constexpr subrange(R&& r) requires (!StoreSize || sized_range); template<@\placeholdernc{forwarding-range}@ R> - requires ConvertibleTo, I> && ConvertibleTo, S> + requires convertible_to, I> && convertible_to, S> constexpr subrange(R&& r, @\placeholdernc{make-unsigned-like-t}@(iter_difference_t) n) requires (K == subrange_kind::sized) : subrange{ranges::begin(r), ranges::end(r), n} @@ -1294,14 +1304,14 @@ [[nodiscard]] constexpr subrange next(iter_difference_t n = 1) const; [[nodiscard]] constexpr subrange prev(iter_difference_t n = 1) const - requires BidirectionalIterator; + requires bidirectional_iterator; constexpr subrange& advance(iter_difference_t n); friend constexpr I begin(subrange&& r) { return r.begin(); } friend constexpr S end(subrange&& r) { return r.end(); } }; - template S> + template S> subrange(I, S, @\placeholdernc{make-unsigned-like-t}@(iter_difference_t)) -> subrange; @@ -1315,7 +1325,7 @@ template<@\placeholder{forwarding-range}@ R> subrange(R&&) -> subrange, sentinel_t, - (SizedRange || SizedSentinel, iterator_t>) + (sized_range || sized_sentinel_for, iterator_t>) ? subrange_kind::sized : subrange_kind::unsized>; template<@\placeholder{forwarding-range}@ R> @@ -1367,9 +1377,9 @@ \pnum \begin{note} Accepting the length of the range and storing it to later return from -\tcode{size()} enables \tcode{subrange} to model \libconcept{SizedRange} even +\tcode{size()} enables \tcode{subrange} to model \libconcept{sized_range} even when it stores an iterator and sentinel that do not model -\libconcept{SizedSentinel}. +\libconcept{sized_sentinel_for}. \end{note} \end{itemdescr} @@ -1377,8 +1387,8 @@ \begin{itemdecl} template<@\placeholdernc{not-same-as}@ R> requires @\placeholdernc{forwarding-range}@ && - ConvertibleTo, I> && ConvertibleTo, S> -constexpr subrange(R&& r) requires (!StoreSize || SizedRange); + convertible_to, I> && convertible_to, S> +constexpr subrange(R&& r) requires (!StoreSize || sized_range); \end{itemdecl} \begin{itemdescr} @@ -1466,7 +1476,7 @@ \pnum \begin{note} -If \tcode{I} does not model \libconcept{ForwardIterator}, \tcode{next} +If \tcode{I} does not model \libconcept{forward_iterator}, \tcode{next} can invalidate \tcode{*this}. \end{note} \end{itemdescr} @@ -1474,7 +1484,7 @@ \indexlibrary{\idxcode{prev}!\idxcode{subrange}}% \begin{itemdecl} [[nodiscard]] constexpr subrange prev(iter_difference_t n = 1) const - requires BidirectionalIterator; + requires bidirectional_iterator; \end{itemdecl} \begin{itemdescr} @@ -1537,10 +1547,10 @@ The tag type \tcode{dangling} is used together with the template aliases \tcode{safe_iterator_t} and \tcode{safe_subrange_t} to indicate that an algorithm -that typically returns an iterator into or subrange of a \tcode{Range} argument +that typically returns an iterator into or subrange of a \tcode{range} argument does not return an iterator or subrange which could potentially reference a range -whose lifetime has ended for a particular rvalue \tcode{Range} argument +whose lifetime has ended for a particular rvalue \tcode{range} argument which does not model \tcode{\placeholder{forwarding-range}}\iref{range.range}. \begin{codeblock} namespace std::ranges { @@ -1557,12 +1567,12 @@ \begin{codeblock} vector f(); auto result1 = ranges::find(f(), 42); // \#1 -static_assert(Same); +static_assert(same_as); auto vec = f(); auto result2 = ranges::find(vec, 42); // \#2 -static_assert(Same::iterator>); +static_assert(same_as::iterator>); auto result3 = ranges::find(subrange{vec}, 42); // \#3 -static_assert(Same::iterator>); +static_assert(same_as::iterator>); \end{codeblock} The call to \tcode{ranges::find} at \#1 returns \tcode{ranges::dangling} since \tcode{f()} is an rvalue \tcode{vector}; @@ -1577,17 +1587,17 @@ \pnum This subclause defines \term{range factories}, -which are utilities to create a \libconcept{View}. +which are utilities to create a \libconcept{view}. \pnum -Range factories are declared in namespace \tcode{std::ranges::view}. +Range factories are declared in namespace \tcode{std::ranges::views}. \rSec2[range.empty]{Empty view} \rSec3[range.empty.overview]{Overview} \pnum -\tcode{empty_view} produces a \libconcept{View} of no elements of +\tcode{empty_view} produces a \libconcept{view} of no elements of a particular type. \pnum @@ -1624,7 +1634,7 @@ \rSec3[range.single.overview]{Overview} \pnum -\tcode{single_view} produces a \libconcept{View} that contains +\tcode{single_view} produces a \libconcept{view} that contains exactly one element of a specified value. \pnum @@ -1640,7 +1650,7 @@ \begin{codeblock} namespace std::ranges { - template + template requires is_object_v class single_view : public view_interface> { private: @@ -1650,7 +1660,7 @@ constexpr explicit single_view(const T& t); constexpr explicit single_view(T&& t); template - requires Constructible + requires constructible_from constexpr single_view(in_place_t, Args&&... args); constexpr T* begin() noexcept; @@ -1739,13 +1749,13 @@ \effects Equivalent to: \tcode{return value_.operator->();} \end{itemdescr} -\rSec3[range.single.adaptor]{\tcode{view::single}} +\rSec3[range.single.adaptor]{\tcode{views::single}} \pnum -The name \tcode{view::single} denotes a +The name \tcode{views::single} denotes a customization point object\iref{customization.point.object}. For some subexpression \tcode{E}, the expression -\tcode{view::single(E)} is expression-equivalent to +\tcode{views::single(E)} is expression-equivalent to \tcode{single_view\{E\}}. \rSec2[range.iota]{Iota view} @@ -1769,13 +1779,13 @@ \begin{codeblock} namespace std::ranges { template - concept @\placeholdernc{Decrementable}@ = // \expos + concept @\placeholdernc{decrementable}@ = // \expos @\seebelow@; template - concept @\placeholdernc{Advanceable}@ = // \expos + concept @\placeholdernc{advanceable}@ = // \expos @\seebelow@; - template + template requires @\placeholdernc{weakly-equality-comparable-with}@ class iota_view : public view_interface> { private: @@ -1793,7 +1803,7 @@ constexpr iterator begin() const; constexpr auto end() const; - constexpr iterator end() const requires Same; + constexpr iterator end() const requires same_as; constexpr auto size() const requires @\seebelow@; }; @@ -1823,18 +1833,18 @@ of width not less than the width of \tcode{W}. \begin{note} It is unspecified - whether this type satisfies \libconcept{WeaklyIncrementable}. + whether this type satisfies \libconcept{weakly_incrementable}. \end{note} \end{itemize} \pnum -The exposition-only \tcode{\placeholder{Decrementable}} concept is equivalent to: +The exposition-only \tcode{\placeholder{decrementable}} concept is equivalent to: \begin{itemdecl} template - concept @\placeholder{Decrementable}@ = - Incrementable && requires(I i) { - { --i } -> Same; - { i-- } -> Same; + concept @\placeholder{decrementable}@ = + incrementable && requires(I i) { + { --i } -> same_as; + { i-- } -> same_as; }; \end{itemdecl} @@ -1845,7 +1855,7 @@ \pnum Let \tcode{a} and \tcode{b} be equal objects of type \tcode{I}. -\tcode{I} models \tcode{\placeholdernc{Decrementable}} only if +\tcode{I} models \tcode{\placeholdernc{decrementable}} only if \begin{itemize} \item If \tcode{a} and \tcode{b} are decrementable, then the following are all true: @@ -1861,18 +1871,18 @@ \end{itemdescr} \pnum -The exposition-only \tcode{\placeholder{Advanceable}} concept is equivalent to: +The exposition-only \tcode{\placeholder{advanceable}} concept is equivalent to: \begin{itemdecl} template - concept @\placeholder{Advanceable}@ = - @\placeholdernc{Decrementable}@ && StrictTotallyOrdered && + concept @\placeholder{advanceable}@ = + @\placeholdernc{decrementable}@ && totally_ordered && requires(I i, const I j, const @\placeholdernc{IOTA-DIFF-T}@(I) n) { - { i += n } -> Same; - { i -= n } -> Same; + { i += n } -> same_as; + { i -= n } -> same_as; I(j + n); I(n + j); I(j - n); - { j - j } -> ConvertibleTo<@\placeholdernc{IOTA-DIFF-T}@(I)>; + { j - j } -> convertible_to<@\placeholdernc{IOTA-DIFF-T}@(I)>; }; \end{itemdecl} @@ -1881,7 +1891,7 @@ \tcode{b} is reachable from \tcode{a} after \tcode{n} applications of \tcode{++a}, for some value \tcode{n} of type \tcode{D}. -\tcode{I} models \tcode{\placeholdernc{Advanceable}} only if +\tcode{I} models \tcode{\placeholdernc{advanceable}} only if \begin{itemize} \item \tcode{(a += n)} is equal to \tcode{b}. \item \tcode{addressof(a += n)} is equal to \tcode{addressof(a)}. @@ -1927,7 +1937,7 @@ \expects \tcode{Bound} denotes \tcode{unreachable_sentinel_t} or \tcode{bound} is reachable from \tcode{value}. -When \tcode{W} and \tcode{Bound} model \libconcept{StrictTotallyOrderedWith}, +When \tcode{W} and \tcode{Bound} model \libconcept{totally_ordered_with}, then \tcode{bool(value <= bound)} is \tcode{true}. \pnum @@ -1954,7 +1964,7 @@ \pnum \effects Equivalent to: \begin{codeblock} -if constexpr (Same) +if constexpr (same_as) return unreachable_sentinel; else return sentinel{bound_}; @@ -1963,7 +1973,7 @@ \indexlibrary{\idxcode{end}!\idxcode{iota_view}}% \begin{itemdecl} -constexpr iterator end() const requires Same; +constexpr iterator end() const requires same_as; \end{itemdecl} \begin{itemdescr} @@ -1993,8 +2003,8 @@ \pnum \remarks The expression in the \grammarterm{requires-clause} is equivalent to \begin{codeblock} -(Same && Advanceable) || (Integral && Integral) || - SizedSentinel +(same_as && @\placeholder{advanceable}@) || (integral && integral) || + sized_sentinel_for \end{codeblock} \end{itemdescr} @@ -2018,42 +2028,42 @@ constexpr iterator& operator++(); constexpr void operator++(int); - constexpr iterator operator++(int) requires Incrementable; + constexpr iterator operator++(int) requires incrementable; - constexpr iterator& operator--() requires @\placeholdernc{Decrementable}@; - constexpr iterator operator--(int) requires @\placeholdernc{Decrementable}@; + constexpr iterator& operator--() requires @\placeholdernc{decrementable}@; + constexpr iterator operator--(int) requires @\placeholdernc{decrementable}@; constexpr iterator& operator+=(difference_type n) - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; constexpr iterator& operator-=(difference_type n) - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; constexpr W operator[](difference_type n) const - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; friend constexpr bool operator==(const iterator& x, const iterator& y) - requires EqualityComparable; + requires equality_comparable; friend constexpr bool operator<(const iterator& x, const iterator& y) - requires StrictTotallyOrdered; + requires totally_ordered; friend constexpr bool operator>(const iterator& x, const iterator& y) - requires StrictTotallyOrdered; + requires totally_ordered; friend constexpr bool operator<=(const iterator& x, const iterator& y) - requires StrictTotallyOrdered; + requires totally_ordered; friend constexpr bool operator>=(const iterator& x, const iterator& y) - requires StrictTotallyOrdered; + requires totally_ordered; friend constexpr compare_three_way_result_t operator<=>( const iterator& x, const iterator& y) - requires StrictTotallyOrdered && ThreeWayComparable; + requires totally_ordered && three_way_comparable; friend constexpr iterator operator+(iterator i, difference_type n) - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; friend constexpr iterator operator+(difference_type n, iterator i) - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; friend constexpr iterator operator-(iterator i, difference_type n) - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; friend constexpr difference_type operator-(const iterator& x, const iterator& y) - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; }; } \end{codeblock} @@ -2061,11 +2071,11 @@ \pnum \tcode{iterator::iterator_category} is defined as follows: \begin{itemize} -\item If \tcode{W} models \tcode{\placeholder{Advanceable}}, then +\item If \tcode{W} models \tcode{\placeholder{advanceable}}, then \tcode{iterator_category} is \tcode{random_access_iterator_tag}. -\item Otherwise, if \tcode{W} models \tcode{\placeholder{Decrementable}}, then +\item Otherwise, if \tcode{W} models \tcode{\placeholder{decrementable}}, then \tcode{iterator_category} is \tcode{bidirectional_iterator_tag}. -\item Otherwise, if \tcode{W} models \libconcept{Incrementable}, then +\item Otherwise, if \tcode{W} models \libconcept{incrementable}, then \tcode{iterator_category} is \tcode{forward_iterator_tag}. \item Otherwise, \tcode{iterator_category} is \tcode{input_iterator_tag}. \end{itemize} @@ -2127,7 +2137,7 @@ \indexlibrary{\idxcode{operator++}!\idxcode{iota_view::iterator}} \begin{itemdecl} -constexpr iterator operator++(int) requires Incrementable; +constexpr iterator operator++(int) requires incrementable; \end{itemdecl} \begin{itemdescr} @@ -2142,7 +2152,7 @@ \indexlibrary{\idxcode{operator\dcr}!\idxcode{iota_view::iterator}} \begin{itemdecl} -constexpr iterator& operator--() requires @\placeholdernc{Decrementable}@; +constexpr iterator& operator--() requires @\placeholdernc{decrementable}@; \end{itemdecl} \begin{itemdescr} @@ -2156,7 +2166,7 @@ \indexlibrary{\idxcode{operator\dcr}!\idxcode{iota_view::iterator}} \begin{itemdecl} -constexpr iterator operator--(int) requires @\placeholdernc{Decrementable}@; +constexpr iterator operator--(int) requires @\placeholdernc{decrementable}@; \end{itemdecl} \begin{itemdescr} @@ -2172,7 +2182,7 @@ \indexlibrary{\idxcode{operator+=}!\idxcode{iota_view::iterator}} \begin{itemdecl} constexpr iterator& operator+=(difference_type n) - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; \end{itemdecl} \begin{itemdescr} @@ -2194,7 +2204,7 @@ \indexlibrary{\idxcode{operator-=}!\idxcode{iota_view::iterator}} \begin{itemdecl} constexpr iterator& operator-=(difference_type n) - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; \end{itemdecl} \begin{itemdescr} @@ -2216,7 +2226,7 @@ \indexlibrary{\idxcode{operator[]}!\idxcode{iota_view::iterator}} \begin{itemdecl} constexpr W operator[](difference_type n) const - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; \end{itemdecl} \begin{itemdescr} @@ -2227,7 +2237,7 @@ \indexlibrary{\idxcode{operator==}!\idxcode{iota_view::iterator}} \begin{itemdecl} friend constexpr bool operator==(const iterator& x, const iterator& y) - requires EqualityComparable; + requires equality_comparable; \end{itemdecl} \begin{itemdescr} @@ -2238,7 +2248,7 @@ \indexlibrary{\idxcode{operator<}!\idxcode{iota_view::iterator}} \begin{itemdecl} friend constexpr bool operator<(const iterator& x, const iterator& y) - requires StrictTotallyOrdered; + requires totally_ordered; \end{itemdecl} \begin{itemdescr} @@ -2249,7 +2259,7 @@ \indexlibrary{\idxcode{operator>}!\idxcode{iota_view::iterator}} \begin{itemdecl} friend constexpr bool operator>(const iterator& x, const iterator& y) - requires StrictTotallyOrdered; + requires totally_ordered; \end{itemdecl} \begin{itemdescr} @@ -2260,7 +2270,7 @@ \indexlibrary{\idxcode{operator<=}!\idxcode{iota_view::iterator}} \begin{itemdecl} friend constexpr bool operator<=(const iterator& x, const iterator& y) - requires StrictTotallyOrdered; + requires totally_ordered; \end{itemdecl} \begin{itemdescr} @@ -2271,7 +2281,7 @@ \indexlibrary{\idxcode{operator>=}!\idxcode{iota_view::iterator}} \begin{itemdecl} friend constexpr bool operator>=(const iterator& x, const iterator& y) - requires StrictTotallyOrdered; + requires totally_ordered; \end{itemdecl} \begin{itemdescr} @@ -2283,7 +2293,7 @@ \begin{itemdecl} friend constexpr compare_three_way_result_t operator<=>(const iterator& x, const iterator& y) - requires StrictTotallyOrdered && ThreeWayComparable; + requires totally_ordered && three_way_comparable; \end{itemdecl} \begin{itemdescr} @@ -2295,7 +2305,7 @@ \indexlibrary{\idxcode{operator+}!\idxcode{iota_view::iterator}} \begin{itemdecl} friend constexpr iterator operator+(iterator i, difference_type n) - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; \end{itemdecl} \begin{itemdescr} @@ -2306,7 +2316,7 @@ \indexlibrary{\idxcode{operator+}!\idxcode{iota_view::iterator}} \begin{itemdecl} friend constexpr iterator operator+(difference_type n, iterator i) - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; \end{itemdecl} \begin{itemdescr} @@ -2317,7 +2327,7 @@ \indexlibrary{\idxcode{operator-}!\idxcode{iota_view::iterator}} \begin{itemdecl} friend constexpr iterator operator-(iterator i, difference_type n) - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; \end{itemdecl} \begin{itemdescr} @@ -2328,7 +2338,7 @@ \indexlibrary{\idxcode{operator-}!\idxcode{iota_view::iterator}} \begin{itemdecl} friend constexpr difference_type operator-(const iterator& x, const iterator& y) - requires @\placeholdernc{Advanceable}@; + requires @\placeholdernc{advanceable}@; \end{itemdecl} \begin{itemdescr} @@ -2364,9 +2374,9 @@ friend constexpr bool operator==(const iterator& x, const sentinel& y); friend constexpr iter_difference_t operator-(const iterator& x, const sentinel& y) - requires SizedSentinel; + requires sized_sentinel_for; friend constexpr iter_difference_t operator-(const sentinel& x, const iterator& y) - requires SizedSentinel; + requires sized_sentinel_for; }; } \end{codeblock} @@ -2393,7 +2403,7 @@ \begin{itemdecl} friend constexpr iter_difference_t operator-(const iterator& x, const sentinel& y) - requires SizedSentinel; + requires sized_sentinel_for; \end{itemdecl} \begin{itemdescr} @@ -2403,7 +2413,7 @@ \begin{itemdecl} friend constexpr iter_difference_t operator-(const sentinel& x, const iterator& y) - requires SizedSentinel; + requires sized_sentinel_for; \end{itemdecl} \begin{itemdescr} @@ -2411,13 +2421,13 @@ \effects Equivalent to: \tcode{return -(y - x);} \end{itemdescr} -\rSec3[range.iota.adaptor]{\tcode{view::iota}} +\rSec3[range.iota.adaptor]{\tcode{views::iota}} \pnum -The name \tcode{view::iota} denotes a +The name \tcode{views::iota} denotes a customization point object\iref{customization.point.object}. For some subexpressions \tcode{E} and \tcode{F}, the expressions -\tcode{view::iota(E)} and \tcode{view::iota(E, F)} +\tcode{views::iota(E)} and \tcode{views::iota(E, F)} are expression-equivalent to \tcode{iota_view\{E\}} and \tcode{iota_view\{E, F\}}, respectively. @@ -2425,12 +2435,12 @@ \pnum This subclause defines \term{range adaptors}, which are utilities that transform a -\libconcept{Range} into a \libconcept{View} with custom behaviors. These +\libconcept{range} into a \libconcept{view} with custom behaviors. These adaptors can be chained to create pipelines of range transformations that evaluate lazily as the resulting view is iterated. \pnum -Range adaptors are declared in namespace \tcode{std::ranges::view}. +Range adaptors are declared in namespace \tcode{std::ranges::views}. \pnum The bitwise \logop{OR} operator is overloaded for the purpose of creating adaptor chain @@ -2443,10 +2453,10 @@ vector ints{0,1,2,3,4,5}; auto even = [](int i){ return 0 == i % 2; }; auto square = [](int i) { return i * i; }; -for (int i : ints | view::filter(even) | view::transform(square)) { +for (int i : ints | views::filter(even) | views::transform(square)) { cout << i << ' '; // prints: 0 4 16 } -assert(ranges::equal(ints | view::filter(even), view::filter(ints, even))); +assert(ranges::equal(ints | views::filter(even), views::filter(ints, even))); \end{codeblock} \end{example} @@ -2454,10 +2464,10 @@ \pnum A \term{range adaptor closure object} is a unary function object that accepts -a \libconcept{ViewableRange} argument and returns a \libconcept{View}. For +a \libconcept{viewable_range} argument and returns a \libconcept{view}. For a range adaptor closure object \tcode{C} and an expression \tcode{R} such that -\tcode{decltype((R))} models \libconcept{ViewableRange}, the following -expressions are equivalent and yield a \libconcept{View}: +\tcode{decltype((R))} models \libconcept{viewable_range}, the following +expressions are equivalent and yield a \libconcept{view}: \begin{codeblock} C(R) @@ -2476,8 +2486,8 @@ \pnum A \term{range adaptor object} is a customization point object\iref{customization.point.object} -that accepts a \libconcept{ViewableRange} as its first argument and returns a -\libconcept{View}. +that accepts a \libconcept{viewable_range} as its first argument and returns a +\libconcept{view}. \pnum If a range adaptor object accepts only one argument, @@ -2507,9 +2517,9 @@ \begin{itemize} \item \tcode{\placeholder{semiregular-box}} constrains its type parameter \tcode{T} with -\tcode{\libconcept{CopyConstructible} \&\& is_object_v}. +\tcode{\libconcept{copy_constructible} \&\& is_object_v}. -\item If \tcode{T} models \libconcept{DefaultConstructible}, the default +\item If \tcode{T} models \libconcept{default_constructible}, the default constructor of \tcode{\placeholder{semiregular-box}} is equivalent to: \begin{codeblock} constexpr @\placeholder{semiregular-box}@() noexcept(is_nothrow_default_constructible_v) @@ -2517,7 +2527,7 @@ { } \end{codeblock} -\item If \tcode{\libconcept{Assignable}} is not +\item If \tcode{\libconcept{assignable_from}} is not modeled, the copy assignment operator is equivalent to: \begin{codeblock} @\placeholder{semiregular-box}@& operator=(const @\placeholder{semiregular-box}@& that) @@ -2529,7 +2539,7 @@ } \end{codeblock} -\item If \tcode{\libconcept{Assignable}} is not modeled, +\item If \tcode{\libconcept{assignable_from}} is not modeled, the move assignment operator is equivalent to: \begin{codeblock} @\placeholder{semiregular-box}@& operator=(@\placeholder{semiregular-box}@&& that) @@ -2545,18 +2555,18 @@ \rSec2[range.all]{All view} \pnum -\tcode{view::all} returns a \libconcept{View} that includes all elements of -its \libconcept{Range} argument. +\tcode{views::all} returns a \libconcept{view} that includes all elements of +its \libconcept{range} argument. \pnum -The name \tcode{view::all} denotes a +The name \tcode{views::all} denotes a range adaptor object\iref{range.adaptor.object}. For some subexpression \tcode{E}, the expression -\tcode{view::all(E)} is expression-equivalent to: +\tcode{views::all(E)} is expression-equivalent to: \begin{itemize} \item \tcode{\placeholdernc{decay-copy}(E)} if the decayed type of \tcode{E} -models \libconcept{View}. +models \libconcept{view}. \item Otherwise, \tcode{ref_view\{E\}} if that expression is well-formed. @@ -2566,10 +2576,10 @@ \rSec3[range.ref.view]{Class template \tcode{ref_view}} \pnum -\tcode{ref_view} is a \tcode{View} of the elements of some other \tcode{Range}. +\tcode{ref_view} is a \tcode{view} of the elements of some other \tcode{range}. \begin{codeblock} namespace std::ranges { - template + template requires is_object_v class ref_view : public view_interface> { private: @@ -2590,10 +2600,10 @@ requires requires { ranges::empty(*r_); } { return ranges::empty(*r_); } - constexpr auto size() const requires SizedRange + constexpr auto size() const requires sized_range { return ranges::size(*r_); } - constexpr auto data() const requires ContiguousRange + constexpr auto data() const requires contiguous_range { return ranges::data(*r_); } friend constexpr iterator_t begin(ref_view r) @@ -2623,7 +2633,7 @@ \end{codeblock} The expression in the \grammarterm{requires-clause} is equivalent to \begin{codeblock} -ConvertibleTo && requires { @\placeholder{FUN}@(declval()); } +convertible_to && requires { @\placeholder{FUN}@(declval()); } \end{codeblock} \pnum @@ -2638,7 +2648,7 @@ \rSec3[range.filter.overview]{Overview} \pnum -\tcode{filter_view} presents a \libconcept{View} of an underlying sequence +\tcode{filter_view} presents a \libconcept{view} of an underlying sequence without the elements that fail to satisfy a predicate. \pnum @@ -2655,8 +2665,8 @@ \begin{codeblock} namespace std::ranges { - template> Pred> - requires View && is_object_v + template> Pred> + requires view && is_object_v class filter_view : public view_interface> { private: V base_ = V(); // \expos @@ -2670,15 +2680,15 @@ public: filter_view() = default; constexpr filter_view(V base, Pred pred); - template - requires ViewableRange && Constructible> + template + requires viewable_range && constructible_from> constexpr filter_view(R&& r, Pred pred); constexpr V base() const; constexpr iterator begin(); constexpr auto end() { - if constexpr (CommonRange) + if constexpr (common_range) return iterator{*this, ranges::end(base_)}; else return sentinel{*this}; @@ -2703,14 +2713,14 @@ \indexlibrary{\idxcode{filter_view}!\idxcode{filter_view}}% \begin{itemdecl} -template - requires ViewableRange && Constructible> +template + requires viewable_range && constructible_from> constexpr filter_view(R&& r, Pred pred); \end{itemdecl} \begin{itemdescr} \pnum -\effects Initializes \tcode{base_} with \tcode{view::all(std::forward(r))} +\effects Initializes \tcode{base_} with \tcode{views::all(std::forward(r))} and initializes \tcode{pred_} with \tcode{std::\brk{}move(pred)}. \end{itemdescr} @@ -2740,7 +2750,7 @@ \pnum \remarks In order to provide the amortized constant time complexity required by -the \libconcept{Range} concept, this function caches the result within the +the \libconcept{range} concept, this function caches the result within the \tcode{filter_view} for use on subsequent calls. \end{itemdescr} @@ -2770,19 +2780,19 @@ constexpr iterator& operator++(); constexpr void operator++(int); - constexpr iterator operator++(int) requires ForwardRange; + constexpr iterator operator++(int) requires forward_range; - constexpr iterator& operator--() requires BidirectionalRange; - constexpr iterator operator--(int) requires BidirectionalRange; + constexpr iterator& operator--() requires bidirectional_range; + constexpr iterator operator--(int) requires bidirectional_range; friend constexpr bool operator==(const iterator& x, const iterator& y) - requires EqualityComparable>; + requires equality_comparable>; friend constexpr range_rvalue_reference_t iter_move(const iterator& i) noexcept(noexcept(ranges::iter_move(i.current_))); friend constexpr void iter_swap(const iterator& x, const iterator& y) noexcept(noexcept(ranges::iter_swap(x.current_, y.current_))) - requires IndirectlySwappable>; + requires indirectly_swappable>; }; } \end{codeblock} @@ -2795,10 +2805,10 @@ \pnum \tcode{iterator::iterator_concept} is defined as follows: \begin{itemize} -\item If \tcode{V} models \libconcept{BidirectionalRange}, then +\item If \tcode{V} models \libconcept{bidirectional_range}, then \tcode{iterator_concept} denotes \tcode{bidirectional_iterator_tag}. -\item Otherwise, if \tcode{V} models \libconcept{ForwardRange}, then +\item Otherwise, if \tcode{V} models \libconcept{forward_range}, then \tcode{iterator_concept} denotes \tcode{forward_iterator_tag}. \item Otherwise, \tcode{iterator_concept} denotes \tcode{input_iterator_tag}. @@ -2810,10 +2820,10 @@ \item Let \tcode{C} denote the type \tcode{iterator_traits>::iterator_category}. -\item If \tcode{C} models \tcode{DerivedFrom}, +\item If \tcode{C} models \tcode{derived_from}, then \tcode{iterator_category} denotes \tcode{bi\-directional_iterator_tag}. -\item Otherwise, if \tcode{C} models \tcode{DerivedFrom}, +\item Otherwise, if \tcode{C} models \tcode{derived_from}, then \tcode{iterator_category} denotes \tcode{forward_iterator_tag}. \item Otherwise, \tcode{iterator_category} denotes \tcode{input_iterator_tag}. @@ -2888,7 +2898,7 @@ \indexlibrary{\idxcode{operator++}!\idxcode{filter_view::iterator}}% \begin{itemdecl} -constexpr iterator operator++(int) requires ForwardRange; +constexpr iterator operator++(int) requires forward_range; \end{itemdecl} \begin{itemdescr} @@ -2903,7 +2913,7 @@ \indexlibrary{\idxcode{operator\dcr}!\idxcode{filter_view::iterator}}% \begin{itemdecl} -constexpr iterator& operator--() requires BidirectionalRange; +constexpr iterator& operator--() requires bidirectional_range; \end{itemdecl} \begin{itemdescr} @@ -2919,7 +2929,7 @@ \indexlibrary{\idxcode{operator\dcr}!\idxcode{filter_view::iterator}}% \begin{itemdecl} -constexpr iterator operator--(int) requires BidirectionalRange; +constexpr iterator operator--(int) requires bidirectional_range; \end{itemdecl} \begin{itemdescr} @@ -2935,7 +2945,7 @@ \indexlibrary{\idxcode{operator==}!\idxcode{filter_view::iterator}}% \begin{itemdecl} friend constexpr bool operator==(const iterator& x, const iterator& y) - requires EqualityComparable>; + requires equality_comparable>; \end{itemdecl} \begin{itemdescr} @@ -2958,7 +2968,7 @@ \begin{itemdecl} friend constexpr void iter_swap(const iterator& x, const iterator& y) noexcept(noexcept(ranges::iter_swap(x.current_, y.current_))) - requires IndirectlySwappable>; + requires indirectly_swappable>; \end{itemdecl} \begin{itemdescr} @@ -3016,13 +3026,13 @@ \effects Equivalent to: \tcode{return x.current_ == y.end_;} \end{itemdescr} -\rSec3[range.filter.adaptor]{\tcode{view::filter}} +\rSec3[range.filter.adaptor]{\tcode{views::filter}} \pnum -The name \tcode{view::filter} denotes a +The name \tcode{views::filter} denotes a range adaptor object\iref{range.adaptor.object}. For some subexpressions \tcode{E} and \tcode{P}, -the expression \tcode{view::filter(E, P)} is expression-equivalent to +the expression \tcode{views::filter(E, P)} is expression-equivalent to \tcode{filter_view\{E, P\}}. @@ -3032,7 +3042,7 @@ \pnum \tcode{transform_view} presents -a \libconcept{View} of an underlying sequence after +a \libconcept{view} of an underlying sequence after applying a transformation function to each element. \pnum @@ -3049,9 +3059,9 @@ \begin{codeblock} namespace std::ranges { - template - requires View && is_object_v && - RegularInvocable> + template + requires view && is_object_v && + regular_invocable> class transform_view : public view_interface> { private: // \ref{range.transform.iterator}, class template \tcode{transform_view::iterator} @@ -3065,28 +3075,28 @@ public: transform_view() = default; constexpr transform_view(V base, F fun); - template - requires ViewableRange && Constructible> + template + requires viewable_range && constructible_from> constexpr transform_view(R&& r, F fun); constexpr V base() const; constexpr iterator begin(); constexpr iterator begin() const - requires Range && - RegularInvocable>; + requires range && + regular_invocable>; constexpr sentinel end(); - constexpr iterator end() requires CommonRange; + constexpr iterator end() requires common_range; constexpr sentinel end() const - requires Range && - RegularInvocable>; + requires range && + regular_invocable>; constexpr iterator end() const - requires CommonRange && - RegularInvocable>; + requires common_range && + regular_invocable>; - constexpr auto size() requires SizedRange { return ranges::size(base_); } - constexpr auto size() const requires SizedRange + constexpr auto size() requires sized_range { return ranges::size(base_); } + constexpr auto size() const requires sized_range { return ranges::size(base_); } }; @@ -3108,14 +3118,14 @@ \indexlibrary{\idxcode{transform_view}!\idxcode{transform_view}}% \begin{itemdecl} -template - requires ViewableRange && Constructible> +template + requires viewable_range && constructible_from> constexpr transform_view(R&& r, F fun); \end{itemdecl} \begin{itemdescr} \pnum -\effects Initializes \tcode{base_} with \tcode{view::all(std::forward(r))} +\effects Initializes \tcode{base_} with \tcode{views::all(std::forward(r))} and \tcode{fun_} with \tcode{std::move(fun)}. \end{itemdescr} @@ -3145,8 +3155,8 @@ \indexlibrary{\idxcode{begin}!\idxcode{transform_view}}% \begin{itemdecl} constexpr iterator begin() const - requires Range && - RegularInvocable>; + requires range && + regular_invocable>; \end{itemdecl} \begin{itemdescr} @@ -3172,7 +3182,7 @@ \indexlibrary{\idxcode{end}!\idxcode{transform_view}}% \begin{itemdecl} -constexpr iterator end() requires CommonRange; +constexpr iterator end() requires common_range; \end{itemdecl} \begin{itemdescr} @@ -3186,8 +3196,8 @@ \indexlibrary{\idxcode{end}!\idxcode{transform_view}}% \begin{itemdecl} constexpr sentinel end() const - requires Range && - RegularInvocable>; + requires range && + regular_invocable>; \end{itemdecl} \begin{itemdescr} @@ -3201,8 +3211,8 @@ \indexlibrary{\idxcode{end}!\idxcode{transform_view}}% \begin{itemdecl} constexpr iterator end() const - requires CommonRange && - RegularInvocable>; + requires common_range && + regular_invocable>; \end{itemdecl} \begin{itemdescr} @@ -3238,7 +3248,7 @@ iterator() = default; constexpr iterator(Parent& parent, iterator_t current); constexpr iterator(iterator i) - requires Const && ConvertibleTo, iterator_t>; + requires Const && convertible_to, iterator_t>; constexpr iterator_t base() const; constexpr decltype(auto) operator*() const @@ -3246,43 +3256,43 @@ constexpr iterator& operator++(); constexpr void operator++(int); - constexpr iterator operator++(int) requires ForwardRange; + constexpr iterator operator++(int) requires forward_range; - constexpr iterator& operator--() requires BidirectionalRange; - constexpr iterator operator--(int) requires BidirectionalRange; + constexpr iterator& operator--() requires bidirectional_range; + constexpr iterator operator--(int) requires bidirectional_range; constexpr iterator& operator+=(difference_type n) - requires RandomAccessRange; + requires random_access_range; constexpr iterator& operator-=(difference_type n) - requires RandomAccessRange; + requires random_access_range; constexpr decltype(auto) operator[](difference_type n) const - requires RandomAccessRange + requires random_access_range { return invoke(*parent_->fun_, current_[n]); } friend constexpr bool operator==(const iterator& x, const iterator& y) - requires EqualityComparable>; + requires equality_comparable>; friend constexpr bool operator<(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; friend constexpr bool operator>(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; friend constexpr bool operator<=(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; friend constexpr bool operator>=(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; friend constexpr compare_three_way_result_t> operator<=>(const iterator& x, const iterator& y) - requires RandomAccessRange && ThreeWayComparable>; + requires random_access_range && three_way_comparable>; friend constexpr iterator operator+(iterator i, difference_type n) - requires RandomAccessRange; + requires random_access_range; friend constexpr iterator operator+(difference_type n, iterator i) - requires RandomAccessRange; + requires random_access_range; friend constexpr iterator operator-(iterator i, difference_type n) - requires RandomAccessRange; + requires random_access_range; friend constexpr difference_type operator-(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; friend constexpr decltype(auto) iter_move(const iterator& i) noexcept(noexcept(invoke(*i.parent_->fun_, *i.current_))) @@ -3295,7 +3305,7 @@ friend constexpr void iter_swap(const iterator& x, const iterator& y) noexcept(noexcept(ranges::iter_swap(x.current_, y.current_))) - requires IndirectlySwappable>; + requires indirectly_swappable>; }; } \end{codeblock} @@ -3303,13 +3313,13 @@ \pnum \tcode{iterator::iterator_concept} is defined as follows: \begin{itemize} -\item If \tcode{V} models \libconcept{RandomAccessRange}, then +\item If \tcode{V} models \libconcept{random_access_range}, then \tcode{iterator_concept} denotes \tcode{random_access_iterator_tag}. -\item Otherwise, if \tcode{V} models \libconcept{BidirectionalRange}, then +\item Otherwise, if \tcode{V} models \libconcept{bidirectional_range}, then \tcode{iterator_concept} denotes \tcode{bidirectional_iterator_tag}. -\item Otherwise, if \tcode{V} models \libconcept{ForwardRange}, then +\item Otherwise, if \tcode{V} models \libconcept{forward_range}, then \tcode{iterator_concept} denotes \tcode{forward_iterator_tag}. \item Otherwise, \tcode{iterator_concept} denotes \tcode{input_iterator_tag}. @@ -3318,7 +3328,7 @@ \pnum Let \tcode{C} denote the type \tcode{iterator_traits>::iterator_category}. -If \tcode{C} models \tcode{\libconcept{Derived\-From}}, +If \tcode{C} models \tcode{\libconcept{derived_from}}, then \tcode{iterator_category} denotes \tcode{random_access_iterator_tag}; otherwise, \tcode{iterator_category} denotes \tcode{C}. @@ -3337,7 +3347,7 @@ \indexlibrary{\idxcode{iterator}!\idxcode{transform_view::iterator}}% \begin{itemdecl} constexpr iterator(iterator i) - requires Const && ConvertibleTo, iterator_t>; + requires Const && convertible_to, iterator_t>; \end{itemdecl} \begin{itemdescr} @@ -3382,7 +3392,7 @@ \indexlibrary{\idxcode{operator++}!\idxcode{transform_view::iterator}} \begin{itemdecl} -constexpr iterator operator++(int) requires ForwardRange; +constexpr iterator operator++(int) requires forward_range; \end{itemdecl} \begin{itemdescr} @@ -3397,7 +3407,7 @@ \indexlibrary{\idxcode{operator\dcr}!\idxcode{transform_view::iterator}} \begin{itemdecl} -constexpr iterator& operator--() requires BidirectionalRange; +constexpr iterator& operator--() requires bidirectional_range; \end{itemdecl} \begin{itemdescr} @@ -3411,7 +3421,7 @@ \indexlibrary{\idxcode{operator\dcr}!\idxcode{transform_view::iterator}} \begin{itemdecl} -constexpr iterator operator--(int) requires BidirectionalRange; +constexpr iterator operator--(int) requires bidirectional_range; \end{itemdecl} \begin{itemdescr} @@ -3427,7 +3437,7 @@ \indexlibrary{\idxcode{operator+=}!\idxcode{transform_view::iterator}} \begin{itemdecl} constexpr iterator& operator+=(difference_type n) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -3442,7 +3452,7 @@ \indexlibrary{\idxcode{operator-=}!\idxcode{transform_view::iterator}}% \begin{itemdecl} constexpr iterator& operator-=(difference_type n) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -3457,7 +3467,7 @@ \indexlibrary{\idxcode{operator==}!\idxcode{transform_view::iterator}} \begin{itemdecl} friend constexpr bool operator==(const iterator& x, const iterator& y) - requires EqualityComparable>; + requires equality_comparable>; \end{itemdecl} \begin{itemdescr} @@ -3468,7 +3478,7 @@ \indexlibrary{\idxcode{operator<}!\idxcode{transform_view::iterator}}% \begin{itemdecl} friend constexpr bool operator<(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -3479,7 +3489,7 @@ \indexlibrary{\idxcode{operator>}!\idxcode{transform_view::iterator}}% \begin{itemdecl} friend constexpr bool operator>(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -3490,7 +3500,7 @@ \indexlibrary{\idxcode{operator<=}!\idxcode{transform_view::iterator}}% \begin{itemdecl} friend constexpr bool operator<=(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -3501,7 +3511,7 @@ \indexlibrary{\idxcode{operator>=}!\idxcode{transform_view::iterator}}% \begin{itemdecl} friend constexpr bool operator>=(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -3513,7 +3523,7 @@ \begin{itemdecl} friend constexpr compare_three_way_result_t> operator<=>(const iterator& x, const iterator& y) - requires RandomAccessRange && ThreeWayComparable>; + requires random_access_range && three_way_comparable>; \end{itemdecl} \begin{itemdescr} @@ -3524,9 +3534,9 @@ \indexlibrary{\idxcode{operator+}!\idxcode{transform_view::iterator}} \begin{itemdecl} friend constexpr iterator operator+(iterator i, difference_type n) - requires RandomAccessRange; + requires random_access_range; friend constexpr iterator operator+(difference_type n, iterator i) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -3537,7 +3547,7 @@ \indexlibrary{\idxcode{operator-}!\idxcode{transform_view::iterator}}% \begin{itemdecl} friend constexpr iterator operator-(iterator i, difference_type n) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -3548,7 +3558,7 @@ \indexlibrary{\idxcode{operator-}!\idxcode{transform_view::iterator}}% \begin{itemdecl} friend constexpr difference_type operator-(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -3560,7 +3570,7 @@ \begin{itemdecl} friend constexpr void iter_swap(const iterator& x, const iterator& y) noexcept(noexcept(ranges::iter_swap(x.current_, y.current_))) - requires IndirectlySwappable>; + requires indirectly_swappable>; \end{itemdecl} \begin{itemdescr} @@ -3585,7 +3595,7 @@ sentinel() = default; constexpr explicit sentinel(sentinel_t end); constexpr sentinel(sentinel i) - requires Const && ConvertibleTo, sentinel_t>; + requires Const && convertible_to, sentinel_t>; constexpr sentinel_t base() const; @@ -3593,10 +3603,10 @@ friend constexpr range_difference_t operator-(const iterator& x, const sentinel& y) - requires SizedSentinel, iterator_t>; + requires sized_sentinel_for, iterator_t>; friend constexpr range_difference_t operator-(const sentinel& y, const iterator& x) - requires SizedSentinel, iterator_t>; + requires sized_sentinel_for, iterator_t>; }; } \end{codeblock} @@ -3614,7 +3624,7 @@ \indexlibrary{\idxcode{sentinel}!\idxcode{transform_view::sentinel}} \begin{itemdecl} constexpr sentinel(sentinel i) - requires Const && ConvertibleTo, sentinel_t>; + requires Const && convertible_to, sentinel_t>; \end{itemdecl} \begin{itemdescr} @@ -3646,7 +3656,7 @@ \begin{itemdecl} friend constexpr range_difference_t operator-(const iterator& x, const sentinel& y) - requires SizedSentinel, iterator_t>; + requires sized_sentinel_for, iterator_t>; \end{itemdecl} \begin{itemdescr} @@ -3658,7 +3668,7 @@ \begin{itemdecl} friend constexpr range_difference_t operator-(const sentinel& y, const iterator& x) - requires SizedSentinel, iterator_t>; + requires sized_sentinel_for, iterator_t>; \end{itemdecl} \begin{itemdescr} @@ -3666,13 +3676,13 @@ \effects Equivalent to: \tcode{return x.end_ - y.current_;} \end{itemdescr} -\rSec3[range.transform.adaptor]{\tcode{view::transform}} +\rSec3[range.transform.adaptor]{\tcode{views::transform}} \pnum -The name \tcode{view::transform} denotes a +The name \tcode{views::transform} denotes a range adaptor object\iref{range.adaptor.object}. For some subexpressions \tcode{E} and \tcode{F}, the expression -\tcode{view::transform(E, F)} is expression-equivalent to +\tcode{views::transform(E, F)} is expression-equivalent to \tcode{transform_view\{E, F\}}. @@ -3681,9 +3691,9 @@ \rSec3[range.take.overview]{Overview} \pnum -\tcode{take_view} produces a \libconcept{View} of the first $N$ elements -from another \libconcept{View}, or all the elements if the adapted -\libconcept{View} contains fewer than $N$. +\tcode{take_view} produces a \libconcept{view} of the first $N$ elements +from another \libconcept{view}, or all the elements if the adapted +\libconcept{view} contains fewer than $N$. \pnum \begin{example} @@ -3699,7 +3709,7 @@ \begin{codeblock} namespace std::ranges { - template + template class take_view : public view_interface> { private: V base_ = V(); // \expos @@ -3709,15 +3719,15 @@ public: take_view() = default; constexpr take_view(V base, range_difference_t count); - template - requires Constructible> + template + requires constructible_from> constexpr take_view(R&& r, range_difference_t count); constexpr V base() const; constexpr auto begin() requires (!@\placeholder{simple-view}@) { - if constexpr (SizedRange) { - if constexpr (RandomAccessRange) + if constexpr (sized_range) { + if constexpr (random_access_range) return ranges::begin(base_); else return counted_iterator{ranges::begin(base_), size()}; @@ -3725,9 +3735,9 @@ return counted_iterator{ranges::begin(base_), count_}; } - constexpr auto begin() const requires Range { - if constexpr (SizedRange) { - if constexpr (RandomAccessRange) + constexpr auto begin() const requires range { + if constexpr (sized_range) { + if constexpr (random_access_range) return ranges::begin(base_); else return counted_iterator{ranges::begin(base_), size()}; @@ -3736,8 +3746,8 @@ } constexpr auto end() requires (!@\placeholder{simple-view}@) { - if constexpr (SizedRange) { - if constexpr (RandomAccessRange) + if constexpr (sized_range) { + if constexpr (random_access_range) return ranges::begin(base_) + size(); else return default_sentinel; @@ -3745,9 +3755,9 @@ return sentinel{ranges::end(base_)}; } - constexpr auto end() const requires Range { - if constexpr (SizedRange) { - if constexpr (RandomAccessRange) + constexpr auto end() const requires range { + if constexpr (sized_range) { + if constexpr (random_access_range) return ranges::begin(base_) + size(); else return default_sentinel; @@ -3755,18 +3765,18 @@ return sentinel{ranges::end(base_)}; } - constexpr auto size() requires SizedRange { + constexpr auto size() requires sized_range { auto n = ranges::size(base_); return ranges::min(n, static_cast(count_)); } - constexpr auto size() const requires SizedRange { + constexpr auto size() const requires sized_range { auto n = ranges::size(base_); return ranges::min(n, static_cast(count_)); } }; - template + template take_view(R&&, range_difference_t) -> take_view>; } @@ -3785,14 +3795,14 @@ \indexlibrary{\idxcode{take_view}!\idxcode{take_view}}% \begin{itemdecl} -template - requires Constructible> +template + requires constructible_from> constexpr take_view(R&& r, range_difference_t count); \end{itemdecl} \begin{itemdescr} \pnum -\effects Initializes \tcode{base_} with \tcode{view::all(std::forward(r))} +\effects Initializes \tcode{base_} with \tcode{views::all(std::forward(r))} and \tcode{count_} with \tcode{count}. \end{itemdescr} @@ -3821,7 +3831,7 @@ sentinel() = default; constexpr explicit sentinel(sentinel_t end); constexpr sentinel(sentinel s) - requires Const && ConvertibleTo, sentinel_t>; + requires Const && convertible_to, sentinel_t>; constexpr sentinel_t base() const; @@ -3843,7 +3853,7 @@ \indexlibrary{\idxcode{sentinel}!\idxcode{take_view::sentinel}}% \begin{itemdecl} constexpr sentinel(sentinel s) - requires Const && ConvertibleTo, sentinel_t>; + requires Const && convertible_to, sentinel_t>; \end{itemdecl} \begin{itemdescr} @@ -3872,13 +3882,13 @@ \tcode{return y.count() == 0 || y.base() == x.end_;} \end{itemdescr} -\rSec3[range.take.adaptor]{\tcode{view::take}} +\rSec3[range.take.adaptor]{\tcode{views::take}} \pnum -The name \tcode{view::take} denotes a +The name \tcode{views::take} denotes a range adaptor object\iref{range.adaptor.object}. For some subexpressions \tcode{E} and \tcode{F}, the expression -\tcode{view::take(E, F)} is expression-equivalent to +\tcode{views::take(E, F)} is expression-equivalent to \tcode{take_view\{E, F\}}. \rSec2[range.take.while]{Take while view} @@ -3886,8 +3896,8 @@ \rSec3[range.take.while.overview]{Overview} \pnum -Given a unary predicate \tcode{pred} and a \tcode{View} \tcode{r}, -\tcode{take_while_view} produces a \tcode{View} +Given a unary predicate \tcode{pred} and a \tcode{view} \tcode{r}, +\tcode{take_while_view} produces a \tcode{view} of the range \range{begin(r)}{ranges::find_if_not(r, pred)}. \pnum @@ -3895,7 +3905,7 @@ \begin{codeblock} auto input = istringstream{"0 1 2 3 4 5 6 7 8 9"}; auto small = [](const auto x) noexcept { return x < 5; }; -auto small_ints = istream_view(input) | view::take_while(small); +auto small_ints = istream_view(input) | views::take_while(small); for (const auto i : small_ints) { cout << i << ' '; // prints \tcode{0 1 2 3 4} } @@ -3909,9 +3919,9 @@ \begin{codeblock} namespace std::ranges { - template - requires InputRange && is_object_v && - IndirectUnaryPredicate> + template + requires input_range && is_object_v && + indirect_unary_predicate> class take_while_view : public view_interface> { template class sentinel; // \expos @@ -3928,13 +3938,13 @@ constexpr auto begin() requires (!@\placeholder{simple-view}@) { return ranges::begin(base_); } - constexpr auto begin() const requires Range + constexpr auto begin() const requires range { return ranges::begin(base_); } constexpr auto end() requires (!@\placeholder{simple-view}@) { return sentinel(ranges::end(base_), addressof(*pred_)); } - constexpr auto end() const requires Range + constexpr auto end() const requires range { return sentinel(ranges::end(base_), addressof(*pred_)); } }; @@ -3988,7 +3998,7 @@ sentinel() = default; constexpr explicit sentinel(sentinel_t end, const Pred* pred); constexpr sentinel(sentinel s) - requires Const && ConvertibleTo, sentinel_t>; + requires Const && convertible_to, sentinel_t>; constexpr sentinel_t base() const { return end_; } @@ -4009,7 +4019,7 @@ \begin{itemdecl} constexpr sentinel(sentinel s) - requires Const && ConvertibleTo, sentinel_t>; + requires Const && convertible_to, sentinel_t>; \end{itemdecl} \begin{itemdescr} @@ -4030,14 +4040,14 @@ \tcode{return y.end_ == x || !invoke(*y.pred_, *x);} \end{itemdescr} -\rSec3[range.take.while.adaptor]{\tcode{view::take_while}} +\rSec3[range.take.while.adaptor]{\tcode{views::take_while}} \indexlibrary{\idxcode{take_while}}% \pnum -The name \tcode{view::take_while} denotes +The name \tcode{views::take_while} denotes a range adaptor object\iref{range.adaptor.object}. For some subexpressions \tcode{E} and \tcode{F}, -the expression \tcode{view::take_while(E, F)} +the expression \tcode{views::take_while(E, F)} is expression-equivalent to \tcode{take_while_view\{E, F\}}. \rSec2[range.drop]{Drop view} @@ -4045,14 +4055,14 @@ \rSec3[range.drop.overview]{Overview} \pnum -\tcode{drop_view} produces a \tcode{View} -excluding the first $N$ elements from another \tcode{View}, or -an empty range if the adapted \tcode{View} contains fewer than $N$ elements. +\tcode{drop_view} produces a \tcode{view} +excluding the first $N$ elements from another \tcode{view}, or +an empty range if the adapted \tcode{view} contains fewer than $N$ elements. \pnum \begin{example} \begin{codeblock} -auto ints = view::iota(0) | view::take(10); +auto ints = views::iota(0) | views::take(10); auto latter_half = drop_view{ints, 5}; for (auto i : latter_half) { cout << i << ' '; // prints \tcode{5 6 7 8 9} @@ -4065,7 +4075,7 @@ \indexlibrary{\idxcode{drop_view}}% \begin{codeblock} namespace std::ranges { - template + template class drop_view : public view_interface> { public: drop_view() = default; @@ -4074,20 +4084,20 @@ constexpr R base() const; constexpr auto begin() - requires (!(@\placeholder{simple-view}@ && RandomAccessRange)); + requires (!(@\placeholder{simple-view}@ && random_access_range)); constexpr auto begin() const - requires RandomAccessRange; + requires random_access_range; constexpr auto end() requires (!@\placeholder{simple-view}@) { return ranges::end(base_); } constexpr auto end() const - requires Range + requires range { return ranges::end(base_); } constexpr auto size() - requires SizedRange + requires sized_range { const auto s = ranges::size(base_); const auto c = static_cast(count_); @@ -4095,7 +4105,7 @@ } constexpr auto size() const - requires SizedRange + requires sized_range { const auto s = ranges::size(base_); const auto c = static_cast(count_); @@ -4141,9 +4151,9 @@ \indexlibrarymember{begin}{drop_view}% \begin{itemdecl} constexpr auto begin() - requires (!(@\placeholder{simple-view}@ && RandomAccessRange)); + requires (!(@\placeholder{simple-view}@ && random_access_range)); constexpr auto begin() const - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -4154,7 +4164,7 @@ \pnum \remarks In order to provide the amortized constant-time complexity required -by the \tcode{Range} concept, +by the \tcode{range} concept, the first overload caches the result within the \tcode{drop_view} for use on subsequent calls. \begin{note} @@ -4164,13 +4174,13 @@ \end{note} \end{itemdescr} -\rSec3[range.drop.adaptor]{\tcode{view::drop}} +\rSec3[range.drop.adaptor]{\tcode{views::drop}} \pnum -The name \tcode{view::drop} denotes +The name \tcode{views::drop} denotes a range adaptor object\iref{range.adaptor.object}. For some subexpressions \tcode{E} and \tcode{F}, -the expression \tcode{view::drop(E, F)} +the expression \tcode{views::drop(E, F)} is expression-equivalent to \tcode{drop_view\{E, F\}}. \rSec2[range.drop.while]{Drop while view} @@ -4178,8 +4188,8 @@ \rSec3[range.drop.while.overview]{Overview} \pnum -Given a unary predicate \tcode{pred} and a \tcode{View} \tcode{r}, -\tcode{drop_while_view} produces a \tcode{View} +Given a unary predicate \tcode{pred} and a \tcode{view} \tcode{r}, +\tcode{drop_while_view} produces a \tcode{view} of the range \range{ranges::find_if_not(r, pred)}{ranges::end(r)}. \pnum @@ -4199,9 +4209,9 @@ \indexlibrary{\idxcode{drop_while_view}}% \begin{codeblock} namespace std::ranges { - template - requires InputRange && is_object_v && - IndirectUnaryPredicate> + template + requires input_range && is_object_v && + indirect_unary_predicate> class drop_while_view : public view_interface> { public: drop_while_view() = default; @@ -4272,7 +4282,7 @@ \pnum \remarks In order to provide the amortized constant-time complexity -required by the \tcode{Range} concept, +required by the \tcode{range} concept, the first call caches the result within the \tcode{drop_while_view} for use on subsequent calls. \begin{note} @@ -4282,13 +4292,13 @@ \end{note} \end{itemdescr} -\rSec3[range.drop.while.adaptor]{\tcode{view::drop_while}} +\rSec3[range.drop.while.adaptor]{\tcode{views::drop_while}} \pnum -The name \tcode{view::drop_while} +The name \tcode{views::drop_while} denotes a range adaptor object\iref{range.adaptor.object}. For some subexpressions \tcode{E} and \tcode{F}, -the expression \tcode{view::drop_while(E, F)} +the expression \tcode{views::drop_while(E, F)} is expression-equivalent to \tcode{drop_while_view\{E, F\}}. \rSec2[range.join]{Join view} @@ -4296,8 +4306,8 @@ \rSec3[range.join.overview]{Overview} \pnum -\tcode{join_view} flattens a \libconcept{View} of ranges into a -\libconcept{View}. +\tcode{join_view} flattens a \libconcept{view} of ranges into a +\libconcept{view}. \pnum \begin{example} @@ -4313,10 +4323,10 @@ \begin{codeblock} namespace std::ranges { - template - requires View && InputRange> && + template + requires view && input_range> && (is_reference_v> || - View>) + view>) class join_view : public view_interface> { private: using InnerRng = // \expos @@ -4335,8 +4345,8 @@ join_view() = default; constexpr explicit join_view(V base); - template - requires ViewableRange && Constructible> + template + requires viewable_range && constructible_from> constexpr explicit join_view(R&& r); constexpr auto begin() { @@ -4344,28 +4354,28 @@ } constexpr auto begin() const - requires InputRange && + requires input_range && is_reference_v> { return iterator{*this, ranges::begin(base_)}; } constexpr auto end() { - if constexpr (ForwardRange && - is_reference_v && ForwardRange && - CommonRange && CommonRange) + if constexpr (forward_range && + is_reference_v && forward_range && + common_range && common_range) return iterator<@\placeholder{simple-view}@>{*this, ranges::end(base_)}; else return sentinel<@\placeholder{simple-view}@>{*this}; } constexpr auto end() const - requires InputRange && + requires input_range && is_reference_v> { - if constexpr (ForwardRange && + if constexpr (forward_range && is_reference_v> && - ForwardRange> && - CommonRange && - CommonRange>) + forward_range> && + common_range && + common_range>) return iterator{*this, ranges::end(base_)}; else return sentinel{*this}; @@ -4389,14 +4399,14 @@ \indexlibrary{\idxcode{join_view}!\idxcode{join_view}}% \begin{itemdecl} -template - requires ViewableRange && Constructible> +template + requires viewable_range && constructible_from> constexpr explicit join_view(R&& r); \end{itemdecl} \begin{itemdescr} \pnum -\effects Initializes \tcode{base_} with \tcode{view::all(std::forward(r))}. +\effects Initializes \tcode{base_} with \tcode{views::all(std::forward(r))}. \end{itemdescr} \rSec3[range.join.iterator]{Class template \tcode{join_view::iterator}} @@ -4431,9 +4441,9 @@ constexpr iterator(Parent& parent, iterator_t outer); constexpr iterator(iterator i) requires Const && - ConvertibleTo, iterator_t> && - ConvertibleTo, - iterator_t>>; + convertible_to, iterator_t> && + convertible_to, + iterator_t>>; constexpr decltype(auto) operator*() const { return *inner_; } @@ -4443,20 +4453,20 @@ constexpr iterator& operator++(); constexpr void operator++(int); constexpr iterator operator++(int) - requires ref_is_glvalue && ForwardRange && - ForwardRange>; + requires ref_is_glvalue && forward_range && + forward_range>; constexpr iterator& operator--() - requires ref_is_glvalue && BidirectionalRange && - BidirectionalRange>; + requires ref_is_glvalue && bidirectional_range && + bidirectional_range>; constexpr iterator operator--(int) - requires ref_is_glvalue && BidirectionalRange && - BidirectionalRange>; + requires ref_is_glvalue && bidirectional_range && + bidirectional_range>; friend constexpr bool operator==(const iterator& x, const iterator& y) - requires ref_is_glvalue && EqualityComparable> && - EqualityComparable>>; + requires ref_is_glvalue && equality_comparable> && + equality_comparable>>; friend constexpr decltype(auto) iter_move(const iterator& i) noexcept(noexcept(ranges::iter_move(i.inner_))) { @@ -4475,10 +4485,10 @@ \item If \tcode{ref_is_glvalue} is \tcode{true}, \begin{itemize} \item If \tcode{Base} and \tcode{range_reference_t} each model - \libconcept{BidirectionalRange}, then \tcode{iterator_concept} denotes + \libconcept{bidirectional_range}, then \tcode{iterator_concept} denotes \tcode{bidirectional_iterator_tag}. \item Otherwise, if \tcode{Base} and \tcode{range_reference_t} - each model \libconcept{ForwardRange}, then \tcode{iterator_concept} denotes + each model \libconcept{forward_range}, then \tcode{iterator_concept} denotes \tcode{forward_iterator_tag}. \end{itemize} \item Otherwise, \tcode{iterator_concept} denotes \tcode{input_iterator_tag}. @@ -4494,10 +4504,10 @@ \item If \tcode{ref_is_glvalue} is \tcode{true}, \begin{itemize} \item If \placeholder{OUTERC} and \placeholder{INNERC} each model - \tcode{DerivedFrom}, \tcode{itera\-tor_category} + \tcode{derived_from}, \tcode{itera\-tor_category} denotes \tcode{bidirectional_iterator_tag}. \item Otherwise, if \placeholder{OUTERC} and \placeholder{INNERC} each model - \tcode{DerivedFrom}, \tcode{itera\-tor_category} + \tcode{derived_from}, \tcode{itera\-tor_category} denotes \tcode{forward_iterator_tag}. \end{itemize} \item Otherwise, \tcode{iterator_category} denotes \tcode{input_iterator_tag}. @@ -4527,7 +4537,7 @@ if constexpr (ref_is_glvalue) // \tcode{x} is a reference return (x); // \tcode{(x)} is an lvalue else - return (parent_->inner_ = view::all(x)); + return (parent_->inner_ = views::all(x)); }; for (; outer_ != ranges::end(parent_->base_); ++outer_) { @@ -4556,9 +4566,9 @@ \begin{itemdecl} constexpr iterator(iterator i) requires Const && - ConvertibleTo, iterator_t> && - ConvertibleTo, - iterator_t>>; + convertible_to, iterator_t> && + convertible_to, + iterator_t>>; \end{itemdecl} \begin{itemdescr} @@ -4617,8 +4627,8 @@ \indexlibrary{\idxcode{operator++}!\idxcode{join_view::iterator}} \begin{itemdecl} constexpr iterator operator++(int) - requires ref_is_glvalue && ForwardRange && - ForwardRange>; + requires ref_is_glvalue && forward_range && + forward_range>; \end{itemdecl} \begin{itemdescr} @@ -4634,8 +4644,8 @@ \indexlibrary{\idxcode{operator\dcr}!\idxcode{join_view::iterator}} \begin{itemdecl} constexpr iterator& operator--() - requires ref_is_glvalue && BidirectionalRange && - BidirectionalRange>; + requires ref_is_glvalue && bidirectional_range && + bidirectional_range>; \end{itemdecl} \begin{itemdescr} @@ -4654,8 +4664,8 @@ \indexlibrary{\idxcode{operator\dcr}!\idxcode{join_view::iterator}} \begin{itemdecl} constexpr iterator operator--(int) - requires ref_is_glvalue && BidirectionalRange && - BidirectionalRange>; + requires ref_is_glvalue && bidirectional_range && + bidirectional_range>; \end{itemdecl} \begin{itemdescr} @@ -4671,8 +4681,8 @@ \indexlibrary{\idxcode{operator==}!\idxcode{join_view::iterator}} \begin{itemdecl} friend constexpr bool operator==(const iterator& x, const iterator& y) - requires ref_is_glvalue && EqualityComparable> && - EqualityComparable>>; + requires ref_is_glvalue && equality_comparable> && + equality_comparable>>; \end{itemdecl} \begin{itemdescr} @@ -4709,7 +4719,7 @@ constexpr explicit sentinel(Parent& parent); constexpr sentinel(sentinel s) - requires Const && ConvertibleTo, sentinel_t>; + requires Const && convertible_to, sentinel_t>; friend constexpr bool operator==(const iterator& x, const sentinel& y); }; @@ -4729,7 +4739,7 @@ \indexlibrary{\idxcode{sentinel}!\idxcode{join_view::sentinel}} \begin{itemdecl} constexpr sentinel(sentinel s) - requires Const && ConvertibleTo, sentinel_t>; + requires Const && convertible_to, sentinel_t>; \end{itemdecl} \begin{itemdescr} @@ -4747,13 +4757,13 @@ \effects Equivalent to: \tcode{return x.outer_ == y.end_;} \end{itemdescr} -\rSec3[range.join.adaptor]{\tcode{view::join}} +\rSec3[range.join.adaptor]{\tcode{views::join}} \pnum -The name \tcode{view::join} denotes a +The name \tcode{views::join} denotes a range adaptor object\iref{range.adaptor.object}. For some subexpression \tcode{E}, the expression -\tcode{view::join(E)} is expression-equivalent to +\tcode{views::join(E)} is expression-equivalent to \tcode{join_view\{E\}}. \rSec2[range.split]{Split view} @@ -4761,9 +4771,9 @@ \rSec3[range.split.overview]{Overview} \pnum -\tcode{split_view} takes a \libconcept{View} and a delimiter, and splits -the \libconcept{View} into subranges on the delimiter. The delimiter can be -a single element or a \libconcept{View} of elements. +\tcode{split_view} takes a \libconcept{view} and a delimiter, and splits +the \libconcept{view} into subranges on the delimiter. The delimiter can be +a single element or a \libconcept{view} of elements. \pnum \begin{example} @@ -4787,19 +4797,19 @@ template concept @\placeholdernc{tiny-range}@ = // \expos - SizedRange && + sized_range && requires { typename @\placeholdernc{require-constant}@::size()>; } && (remove_reference_t::size() <= 1); - template - requires View && View && - IndirectlyComparable, iterator_t, ranges::equal_to> && - (ForwardRange || @\placeholdernc{tiny-range}@) + template + requires view && view && + indirectly_comparable, iterator_t, ranges::equal_to> && + (forward_range || @\placeholdernc{tiny-range}@) class split_view : public view_interface> { private: V base_ = V(); // \expos Pattern pattern_ = Pattern(); // \expos - iterator_t current_ = iterator_t(); // \expos, present only if \tcode{!ForwardRange} + iterator_t current_ = iterator_t(); // \expos, present only if \tcode{!forward_range} // \ref{range.split.outer}, class template \tcode{split_view::outer_iterator} template struct outer_iterator; // \expos // \ref{range.split.inner}, class template \tcode{split_view::inner_iterator} @@ -4808,18 +4818,18 @@ split_view() = default; constexpr split_view(V base, Pattern pattern); - template - requires Constructible> && - Constructible> + template + requires constructible_from> && + constructible_from> constexpr split_view(R&& r, P&& p); - template - requires Constructible> && - Constructible>> + template + requires constructible_from> && + constructible_from>> constexpr split_view(R&& r, range_value_t e); constexpr auto begin() { - if constexpr (ForwardRange) + if constexpr (forward_range) return outer_iterator<@\placeholder{simple-view}@>{*this, ranges::begin(base_)}; else { current_ = ranges::begin(base_); @@ -4827,16 +4837,16 @@ } } - constexpr auto begin() const requires ForwardRange && ForwardRange { + constexpr auto begin() const requires forward_range && forward_range { return outer_iterator{*this, ranges::begin(base_)}; } - constexpr auto end() requires ForwardRange && CommonRange { + constexpr auto end() requires forward_range && common_range { return outer_iterator<@\placeholder{simple-view}@>{*this, ranges::end(base_)}; } constexpr auto end() const { - if constexpr (ForwardRange && ForwardRange && CommonRange) + if constexpr (forward_range && forward_range && common_range) return outer_iterator{*this, ranges::end(base_)}; else return default_sentinel; @@ -4846,7 +4856,7 @@ template split_view(R&&, P&&) -> split_view, all_view

>; - template + template split_view(R&&, range_value_t) -> split_view, single_view>>; } @@ -4865,31 +4875,31 @@ \indexlibrary{\idxcode{split_view}!\idxcode{split_view}}% \begin{itemdecl} -template - requires Constructible> && - Constructible> +template + requires constructible_from> && + constructible_from> constexpr split_view(R&& r, P&& p); \end{itemdecl} \begin{itemdescr} \pnum \effects -Initializes \tcode{base_} with \tcode{view::all(std::forward(r))} and -\tcode{pattern_} with \tcode{view::all(std\brk{}::forward

(p))}. +Initializes \tcode{base_} with \tcode{views::all(std::forward(r))}, and +\tcode{pattern_} with \tcode{views::all(\brk{}std::forward

(p))}. \end{itemdescr} \indexlibrary{\idxcode{split_view}!\idxcode{split_view}}% \begin{itemdecl} -template - requires Constructible> && - Constructible>> +template + requires constructible_from> && + constructible_from>> constexpr split_view(R&& r, range_value_t e); \end{itemdecl} \begin{itemdescr} \pnum \effects -Initializes \tcode{base_} with \tcode{view::all(std::forward(r))} and +Initializes \tcode{base_} with \tcode{views::all(std::forward(r))}, and \tcode{pattern_} with \tcode{single_view\{\brk{}std::move(e)\}}. \end{itemdescr} @@ -4906,12 +4916,12 @@ using Base = // \expos conditional_t; Parent* parent_ = nullptr; // \expos - iterator_t current_ = // \expos, present only if \tcode{V} models \libconcept{ForwardRange} + iterator_t current_ = // \expos, present only if \tcode{V} models \libconcept{forward_range} iterator_t(); public: using iterator_concept = - conditional_t, forward_iterator_tag, input_iterator_tag>; + conditional_t, forward_iterator_tag, input_iterator_tag>; using iterator_category = input_iterator_tag; // \ref{range.split.outer.value}, class \tcode{split_view::outer_iterator::value_type} struct value_type; @@ -4919,17 +4929,17 @@ outer_iterator() = default; constexpr explicit outer_iterator(Parent& parent) - requires (!ForwardRange); + requires (!forward_range); constexpr outer_iterator(Parent& parent, iterator_t current) - requires ForwardRange; + requires forward_range; constexpr outer_iterator(outer_iterator i) - requires Const && ConvertibleTo, iterator_t>; + requires Const && convertible_to, iterator_t>; constexpr value_type operator*() const; constexpr outer_iterator& operator++(); constexpr decltype(auto) operator++(int) { - if constexpr (ForwardRange) { + if constexpr (forward_range) { auto tmp = *this; ++*this; return tmp; @@ -4938,7 +4948,7 @@ } friend constexpr bool operator==(const outer_iterator& x, const outer_iterator& y) - requires ForwardRange; + requires forward_range; friend constexpr bool operator==(const outer_iterator& x, default_sentinel_t); }; @@ -4949,12 +4959,12 @@ Many of the following specifications refer to the notional member \tcode{\placeholder{current}} of \tcode{outer_iterator}. \tcode{\placeholder{current}} is equivalent to \tcode{current_} if \tcode{V} -models \libconcept{ForwardRange}, and \tcode{parent_->current_} otherwise. +models \libconcept{forward_range}, and \tcode{parent_->current_} otherwise. \indexlibrary{\idxcode{outer_iterator}!\idxcode{split_view::outer_iterator}}% \begin{itemdecl} constexpr explicit outer_iterator(Parent& parent) - requires (!ForwardRange); + requires (!forward_range); \end{itemdecl} \begin{itemdescr} @@ -4965,7 +4975,7 @@ \indexlibrary{\idxcode{outer_iterator}!\idxcode{split_view::outer_iterator}}% \begin{itemdecl} constexpr outer_iterator(Parent& parent, iterator_t current) - requires ForwardRange; + requires forward_range; \end{itemdecl} \begin{itemdescr} @@ -4977,7 +4987,7 @@ \indexlibrary{\idxcode{outer_iterator}!\idxcode{split_view::outer_iterator}}% \begin{itemdecl} constexpr outer_iterator(outer_iterator i) - requires Const && ConvertibleTo, iterator_t>; + requires Const && convertible_to, iterator_t>; \end{itemdecl} \begin{itemdescr} @@ -5025,7 +5035,7 @@ \indexlibrary{\idxcode{operator==}!\idxcode{split_view::outer_iterator}}% \begin{itemdecl} friend constexpr bool operator==(const outer_iterator& x, const outer_iterator& y) - requires ForwardRange; + requires forward_range; \end{itemdecl} \begin{itemdescr} @@ -5118,7 +5128,7 @@ constexpr inner_iterator& operator++(); constexpr decltype(auto) operator++(int) { - if constexpr (ForwardRange) { + if constexpr (forward_range) { auto tmp = *this; ++*this; return tmp; @@ -5127,7 +5137,7 @@ } friend constexpr bool operator==(const inner_iterator& x, const inner_iterator& y) - requires ForwardRange; + requires forward_range; friend constexpr bool operator==(const inner_iterator& x, default_sentinel_t); @@ -5138,7 +5148,7 @@ friend constexpr void iter_swap(const inner_iterator& x, const inner_iterator& y) noexcept(noexcept(ranges::iter_swap(x.i_.@\placeholdernc{current}, y.i_.\placeholdernc{current}@))) - requires IndirectlySwappable>; + requires indirectly_swappable>; }; } \end{codeblock} @@ -5147,7 +5157,7 @@ The \grammarterm{typedef-name} \tcode{iterator_category} denotes \tcode{forward_iterator_tag} if \tcode{iterator_traits>::iterator_category} models -\tcode{DerivedFrom}, and \tcode{input_iterator_tag} +\tcode{derived_from}, and \tcode{input_iterator_tag} otherwise. \indexlibrary{\idxcode{inner_iterator}!\idxcode{split_view::inner_iterator}}% @@ -5170,7 +5180,7 @@ \effects Equivalent to: \begin{codeblock} incremented_ = true; -if constexpr (!ForwardRange) { +if constexpr (!forward_range) { if constexpr (Pattern::size() == 0) { return *this; } @@ -5183,7 +5193,7 @@ \indexlibrary{\idxcode{operator==}!\idxcode{split_view::inner_iterator}}% \begin{itemdecl} friend constexpr bool operator==(const inner_iterator& x, const inner_iterator& y) - requires ForwardRange; + requires forward_range; \end{itemdecl} \begin{itemdescr} @@ -5217,7 +5227,7 @@ \begin{itemdecl} friend constexpr void iter_swap(const inner_iterator& x, const inner_iterator& y) noexcept(noexcept(ranges::iter_swap(x.i_.@\placeholdernc{current}, y.i_.\placeholdernc{current}@))) - requires IndirectlySwappable>; + requires indirectly_swappable>; \end{itemdecl} \begin{itemdescr} @@ -5226,43 +5236,43 @@ \tcode{ranges::iter_swap(x.i_.\placeholdernc{current}, y.i_.\placeholdernc{current})}. \end{itemdescr} -\rSec3[range.split.adaptor]{\tcode{view::split}} +\rSec3[range.split.adaptor]{\tcode{views::split}} \pnum -The name \tcode{view::split} denotes a +The name \tcode{views::split} denotes a range adaptor object\iref{range.adaptor.object}. For some subexpressions \tcode{E} and \tcode{F}, -the expression \tcode{view::split(E, F)} is expression-equivalent to +the expression \tcode{views::split(E, F)} is expression-equivalent to \tcode{split_view\{E, F\}}. \rSec2[range.counted]{Counted view} \pnum -A counted view presents a \libconcept{View} of the elements +A counted view presents a \libconcept{view} of the elements of the counted range\iref{iterator.requirements.general} \range{i}{n} for some iterator \tcode{i} and non-negative integer \tcode{n}. \pnum -The name \tcode{view::counted} denotes a +The name \tcode{views::counted} denotes a customization point object\iref{customization.point.object}. Let \tcode{E} and \tcode{F} be expressions, and let \tcode{T} be \tcode{decay_t}. -Then the expression \tcode{view::counted(E, F)} is expression-equivalent to: +Then the expression \tcode{views::counted(E, F)} is expression-equivalent to: \begin{itemize} -\item If \tcode{T} models \libconcept{Iterator} and - \tcode{decltype((F))} models \libconcept{ConvertibleTo>}, +\item If \tcode{T} models \libconcept{input_or_output_iterator} and + \tcode{decltype((F))} models \tcode{\libconcept{convertible_to}>}, \begin{itemize} \item \tcode{subrange\{E, E + static_cast>(F)\}} - if \tcode{T} models \libconcept{RandomAccessItera\-tor}. + if \tcode{T} models \libconcept{random_access_\-it\-er\-ator}. \item Otherwise, \tcode{subrange\{counted_iterator\{E, F\}, default_sentinel\}}. \end{itemize} -\item Otherwise, \tcode{view::counted(E, F)} is ill-formed. +\item Otherwise, \tcode{views::counted(E, F)} is ill-formed. \begin{note} - This case can result in substitution failure when \tcode{view::counted(E, F)} + This case can result in substitution failure when \tcode{views::counted(E, F)} appears in the immediate context of a template instantiation. \end{note} \end{itemize} @@ -5272,8 +5282,8 @@ \rSec3[range.common.overview]{Overview} \pnum -\tcode{common_view} takes a \libconcept{View} which has different types for -its iterator and sentinel and turns it into a \libconcept{View} of the same +\tcode{common_view} takes a \libconcept{view} which has different types for +its iterator and sentinel and turns it into a \libconcept{view} of the same elements with an iterator and sentinel of the same type. \pnum @@ -5289,7 +5299,7 @@ template size_t count(ForwardIterator first, ForwardIterator last); -template +template void my_algo(R&& r) { auto&& common = common_view{r}; auto cnt = count(common.begin(), common.end()); @@ -5302,8 +5312,8 @@ \begin{codeblock} namespace std::ranges { - template - requires (!CommonRange) + template + requires (!common_range) class common_view : public view_interface> { private: V base_ = V(); // \expos @@ -5312,42 +5322,42 @@ constexpr explicit common_view(V r); - template - requires (!CommonRange && Constructible>) + template + requires (!common_range && constructible_from>) constexpr explicit common_view(R&& r); constexpr V base() const; - constexpr auto size() requires SizedRange { + constexpr auto size() requires sized_range { return ranges::size(base_); } - constexpr auto size() const requires SizedRange { + constexpr auto size() const requires sized_range { return ranges::size(base_); } constexpr auto begin() { - if constexpr (RandomAccessRange && SizedRange) + if constexpr (random_access_range && sized_range) return ranges::begin(base_); else return common_iterator, sentinel_t>(ranges::begin(base_)); } - constexpr auto begin() const requires Range { - if constexpr (RandomAccessRange && SizedRange) + constexpr auto begin() const requires range { + if constexpr (random_access_range && sized_range) return ranges::begin(base_); else return common_iterator, sentinel_t>(ranges::begin(base_)); } constexpr auto end() { - if constexpr (RandomAccessRange && SizedRange) + if constexpr (random_access_range && sized_range) return ranges::begin(base_) + ranges::size(base_); else return common_iterator, sentinel_t>(ranges::end(base_)); } - constexpr auto end() const requires Range { - if constexpr (RandomAccessRange && SizedRange) + constexpr auto end() const requires range { + if constexpr (random_access_range && sized_range) return ranges::begin(base_) + ranges::size(base_); else return common_iterator, sentinel_t>(ranges::end(base_)); @@ -5371,14 +5381,14 @@ \indexlibrary{\idxcode{common_view}!\idxcode{common_view}}% \begin{itemdecl} -template - requires (!CommonRange && Constructible>) +template + requires (!common_range && constructible_from>) constexpr explicit common_view(R&& r); \end{itemdecl} \begin{itemdescr} \pnum -\effects Initializes \tcode{base_} with \tcode{view::all(std::forward(r))}. +\effects Initializes \tcode{base_} with \tcode{views::all(std::forward(r))}. \end{itemdescr} \indexlibrary{\idxcode{base}!\idxcode{common_view}}% @@ -5391,18 +5401,18 @@ \effects Equivalent to: \tcode{return base_;} \end{itemdescr} -\rSec3[range.common.adaptor]{\tcode{view::common}} +\rSec3[range.common.adaptor]{\tcode{views::common}} \pnum -The name \tcode{view::common} denotes a +The name \tcode{views::common} denotes a range adaptor object\iref{range.adaptor.object}. For some subexpression \tcode{E}, -the expression \tcode{view::common(E)} is expression-equivalent to: +the expression \tcode{views::common(E)} is expression-equivalent to: \begin{itemize} -\item \tcode{view::all(E)}, - if \tcode{decltype((E))} models \libconcept{CommonRange} - and \tcode{view::all(E)} is a well-formed expression. +\item \tcode{views::all(E)}, + if \tcode{decltype((E))} models \libconcept{common_range} + and \tcode{views::all(E)} is a well-formed expression. \item Otherwise, \tcode{common_view\{E\}}. \end{itemize} @@ -5412,8 +5422,8 @@ \rSec3[range.reverse.overview]{Overview} \pnum -\tcode{reverse_view} takes a bidirectional \libconcept{View} and produces -another \libconcept{View} that iterates the same elements in reverse order. +\tcode{reverse_view} takes a bidirectional \libconcept{view} and produces +another \libconcept{view} that iterates the same elements in reverse order. \pnum \begin{example} @@ -5430,8 +5440,8 @@ \indexlibrary{\idxcode{weiv_esrever}}% \begin{codeblock} namespace std::ranges { - template - requires BidirectionalRange + template + requires bidirectional_range class reverse_view : public view_interface> { private: V base_ = V(); // \expos @@ -5440,25 +5450,25 @@ constexpr explicit reverse_view(V r); - template - requires BidirectionalRange && Constructible> + template + requires bidirectional_range && constructible_from> constexpr explicit reverse_view(R&& r); constexpr V base() const; constexpr reverse_iterator> begin(); - constexpr reverse_iterator> begin() requires CommonRange; + constexpr reverse_iterator> begin() requires common_range; constexpr reverse_iterator> begin() const - requires CommonRange; + requires common_range; constexpr reverse_iterator> end(); constexpr reverse_iterator> end() const - requires CommonRange; + requires common_range; - constexpr auto size() requires SizedRange { + constexpr auto size() requires sized_range { return ranges::size(base_); } - constexpr auto size() const requires SizedRange { + constexpr auto size() const requires sized_range { return ranges::size(base_); } }; @@ -5480,14 +5490,14 @@ \indexlibrary{\idxcode{reverse_view}!\idxcode{reverse_view}}% \begin{itemdecl} -template - requires BidirectionalRange && Constructible> +template + requires bidirectional_range && constructible_from> constexpr explicit reverse_view(R&& r); \end{itemdecl} \begin{itemdescr} \pnum -\effects Initializes \tcode{base_} with \tcode{view::all(std::forward(r))}. +\effects Initializes \tcode{base_} with \tcode{views::all(std::forward(r))}. \end{itemdescr} \indexlibrary{\idxcode{base}!\idxcode{reverse_view}}% @@ -5514,15 +5524,15 @@ \pnum \remarks In order to provide the amortized constant time complexity required by -the \libconcept{Range} concept, this function caches the result within the +the \libconcept{range} concept, this function caches the result within the \tcode{reverse_view} for use on subsequent calls. \end{itemdescr} \indexlibrary{\idxcode{begin}!\idxcode{reverse_view}}% \begin{itemdecl} -constexpr reverse_iterator> begin() requires CommonRange; +constexpr reverse_iterator> begin() requires common_range; constexpr reverse_iterator> begin() const - requires CommonRange; + requires common_range; \end{itemdecl} \begin{itemdescr} @@ -5534,7 +5544,7 @@ \begin{itemdecl} constexpr reverse_iterator> end(); constexpr reverse_iterator> end() const - requires CommonRange; + requires common_range; \end{itemdecl} \begin{itemdescr} @@ -5542,13 +5552,13 @@ \effects Equivalent to: \tcode{return make_reverse_iterator(ranges::begin(base_));} \end{itemdescr} -\rSec3[range.reverse.adaptor]{\tcode{view::reverse}} +\rSec3[range.reverse.adaptor]{\tcode{views::reverse}} \pnum -The name \tcode{view::reverse} denotes a +The name \tcode{views::reverse} denotes a range adaptor object\iref{range.adaptor.object}. For some subexpression \tcode{E}, the expression -\tcode{view::reverse(E)} is expression-equivalent to: +\tcode{views::reverse(E)} is expression-equivalent to: \begin{itemize} \item If the type of \tcode{E} is @@ -5583,7 +5593,7 @@ \rSec3[range.istream.overview]{Overview} \pnum -\tcode{basic_istream_view} models \tcode{InputRange} and +\tcode{basic_istream_view} models \tcode{input_range} and reads (using \tcode{operator>>}) successive elements from its corresponding input stream. @@ -5607,8 +5617,8 @@ is >> t; }; - template - requires DefaultConstructible && + template + requires default_constructible && @\placeholder{stream-extractable}@ class basic_istream_view : public view_interface> { public: @@ -5771,15 +5781,15 @@ \pnum \tcode{elements_view} takes -a \tcode{View} of tuple-like values and a \tcode{size_t}, and -produces a \tcode{View} with a value-type of the $N^\text{th}$ element -of the adapted \tcode{View}'s value-type. +a \tcode{view} of tuple-like values and a \tcode{size_t}, and +produces a \tcode{view} with a value-type of the $N^\text{th}$ element +of the adapted \tcode{view}'s value-type. \pnum -The name \tcode{view::elements} denotes +The name \tcode{views::elements} denotes a range adaptor object\iref{range.adaptor.object}. For some subexpression \tcode{E} and constant expression \tcode{N}, -the expression \tcode{view::elements(E)} is expression-equivalent to +the expression \tcode{views::elements(E)} is expression-equivalent to \tcode{elements_view, N>\{E\}}. \begin{example} @@ -5791,12 +5801,12 @@ {"Hamilton"sv, 1936} }; -auto names = historical_figures | view::elements<0>; +auto names = historical_figures | views::elements<0>; for (auto&& name : names) { cout << name << ' '; // prints \tcode{Babbage Hamilton Lovelace Turing } } -auto birth_years = historical_figures | view::elements<1>; +auto birth_years = historical_figures | views::elements<1>; for (auto&& born : birth_years) { cout << born << ' '; // prints \tcode{1791 1936 1815 1912 } } @@ -5842,8 +5852,8 @@ }; - template - requires View && @\placeholder{has-tuple-element}@, N> && + template + requires view && @\placeholder{has-tuple-element}@, N> && @\placeholder{has-tuple-element}@>, N> class elements_view : public view_interface> { public: @@ -5864,10 +5874,10 @@ constexpr auto end() const requires @\placeholder{simple-view}@ { return ranges::end(base_); } - constexpr auto size() requires SizedRange + constexpr auto size() requires sized_range { return ranges::size(base_); } - constexpr auto size() const requires SizedRange + constexpr auto size() const requires sized_range { return ranges::size(base_); } private: @@ -5918,7 +5928,7 @@ iterator() = default; constexpr explicit iterator(iterator_t current); constexpr iterator(iterator i) - requires Const && ConvertibleTo, iterator_t>; + requires Const && convertible_to, iterator_t>; constexpr iterator_t base() const; @@ -5926,52 +5936,52 @@ { return get(*current_); } constexpr iterator& operator++(); - constexpr void operator++(int) requires (!ForwardRange); - constexpr iterator operator++(int) requires ForwardRange; + constexpr void operator++(int) requires (!forward_range); + constexpr iterator operator++(int) requires forward_range; - constexpr iterator& operator--() requires BidirectionalRange; - constexpr iterator operator--(int) requires BidirectionalRange; + constexpr iterator& operator--() requires bidirectional_range; + constexpr iterator operator--(int) requires bidirectional_range; constexpr iterator& operator+=(difference_type x) - requires RandomAccessRange; + requires random_access_range; constexpr iterator& operator-=(difference_type x) - requires RandomAccessRange; + requires random_access_range; constexpr decltype(auto) operator[](difference_type n) const - requires RandomAccessRange + requires random_access_range { return get(*(current_ + n)); } friend constexpr bool operator==(const iterator& x, const iterator& y) - requires EqualityComparable>; + requires equality_comparable>; friend constexpr bool operator==(const iterator& x, const sentinel_t& y); friend constexpr bool operator<(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; friend constexpr bool operator>(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; friend constexpr bool operator<=(const iterator& y, const iterator& y) - requires RandomAccessRange; + requires random_access_range; friend constexpr bool operator>=(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; friend constexpr compare_three_way_result_t> operator<=>(const iterator& x, const iterator& y) - requires RandomAccessRange && ThreeWayComparable>; + requires random_access_range && three_way_comparable>; friend constexpr iterator operator+(const iterator& x, difference_type y) - requires RandomAccessRange; + requires random_access_range; friend constexpr iterator operator+(difference_type x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; friend constexpr iterator operator-(const iterator& x, difference_type y) - requires RandomAccessRange; + requires random_access_range; friend constexpr difference_type operator-(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; friend constexpr difference_type operator-(const iterator& x, const sentinel_t& y) - requires SizedSentinel, iterator_t>; + requires sized_sentinel_for, iterator_t>; friend constexpr difference_type operator-(const sentinel_t& x, const iterator& y) - requires SizedSentinel, iterator_t>; + requires sized_sentinel_for, iterator_t>; }; } \end{codeblock} @@ -5988,7 +5998,7 @@ \begin{itemdecl} constexpr iterator(iterator i) - requires Const && ConvertibleTo, iterator_t>; + requires Const && convertible_to, iterator_t>; \end{itemdecl} \begin{itemdescr} @@ -6021,7 +6031,7 @@ \end{itemdescr} \begin{itemdecl} -constexpr void operator++(int) requires (!ForwardRange); +constexpr void operator++(int) requires (!forward_range); \end{itemdecl} \begin{itemdescr} @@ -6031,7 +6041,7 @@ \end{itemdescr} \begin{itemdecl} -constexpr iterator operator++(int) requires ForwardRange; +constexpr iterator operator++(int) requires forward_range; \end{itemdecl} \begin{itemdescr} @@ -6045,7 +6055,7 @@ \end{itemdescr} \begin{itemdecl} -constexpr iterator& operator--() requires BidirectionalRange; +constexpr iterator& operator--() requires bidirectional_range; \end{itemdecl} \begin{itemdescr} @@ -6059,7 +6069,7 @@ \end{itemdescr} \begin{itemdecl} -constexpr iterator operator--(int) requires BidirectionalRange; +constexpr iterator operator--(int) requires bidirectional_range; \end{itemdecl} \begin{itemdescr} @@ -6075,7 +6085,7 @@ \begin{itemdecl} constexpr iterator& operator+=(difference_type n); - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -6090,7 +6100,7 @@ \begin{itemdecl} constexpr iterator& operator-=(difference_type n) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -6105,7 +6115,7 @@ \begin{itemdecl} friend constexpr bool operator==(const iterator& x, const iterator& y) - requires EqualityComparable; + requires equality_comparable; \end{itemdecl} \begin{itemdescr} @@ -6126,7 +6136,7 @@ \begin{itemdecl} friend constexpr bool operator<(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -6137,7 +6147,7 @@ \begin{itemdecl} friend constexpr bool operator>(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -6148,7 +6158,7 @@ \begin{itemdecl} friend constexpr bool operator<=(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -6159,7 +6169,7 @@ \begin{itemdecl} friend constexpr bool operator>=(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -6171,7 +6181,7 @@ \begin{itemdecl} friend constexpr compare_three_way_result_t> operator<=>(const iterator& x, const iterator& y) - requires RandomAccessRange && ThreeWayComparable>; + requires random_access_range && three_way_comparable>; \end{itemdecl} \begin{itemdescr} @@ -6182,7 +6192,7 @@ \begin{itemdecl} friend constexpr iterator operator+(const iterator& x, difference_type y) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -6192,7 +6202,7 @@ \begin{itemdecl} friend constexpr iterator operator+(difference_type x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -6202,7 +6212,7 @@ \begin{itemdecl} constexpr iterator operator-(const iterator& x, difference_type y) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -6213,7 +6223,7 @@ \begin{itemdecl} constexpr difference_type operator-(const iterator& x, const iterator& y) - requires RandomAccessRange; + requires random_access_range; \end{itemdecl} \begin{itemdescr} @@ -6225,7 +6235,7 @@ \begin{itemdecl} friend constexpr difference_type operator-(const iterator& x, const sentinel_t& y) - requires SizedSentinel, iterator_t>; + requires sized_sentinel_for, iterator_t>; \end{itemdecl} \begin{itemdescr} @@ -6237,7 +6247,7 @@ \begin{itemdecl} friend constexpr difference_type operator-(const sentinel_t& x, const iterator& y) - requires SizedSentinel, iterator_t>; + requires sized_sentinel_for, iterator_t>; \end{itemdecl} \begin{itemdescr} diff --git a/source/strings.tex b/source/strings.tex index 718d27f744..a0c3c16f35 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -4092,7 +4092,7 @@ A type that meets the requirements of a constant \oldconcept{RandomAccessIterator}\iref{random.access.iterators}, -models \libconcept{ContiguousIterator}\iref{iterator.concept.contiguous}, and +models \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous}, and meets the constexpr iterator requirements\iref{iterator.requirements.general}, whose \tcode{value_type} is the template parameter \tcode{charT}. diff --git a/source/support.tex b/source/support.tex index 56e3c7b9d3..479ef83eb6 100644 --- a/source/support.tex +++ b/source/support.tex @@ -4021,11 +4021,11 @@ template using common_comparison_category_t = typename common_comparison_category::type; - // \ref{cmp.concept}, concept \tcode{ThreeWayComparable} + // \ref{cmp.concept}, concept \tcode{three_way_comparable} template - concept ThreeWayComparable = @\seebelow@; + concept three_way_comparable = @\seebelow@; template - concept ThreeWayComparableWith = @\seebelow@; + concept three_way_comparable_with = @\seebelow@; // \ref{cmp.result}, result of three-way comparison template struct compare_three_way_result; @@ -4709,24 +4709,24 @@ \end{note} \end{itemdescr} -\rSec2[cmp.concept]{Concept \tcode{ThreeWayComparable}} +\rSec2[cmp.concept]{Concept \tcode{three_way_comparable}} \begin{codeblock} template concept @\placeholder{compares-as}@ = // \expos - Same, Cat>; + same_as, Cat>; template concept @\placeholder{partially-ordered-with}@ = // \expos requires(const remove_reference_t& t, const remove_reference_t& u) { - { t < u } -> Boolean; - { t > u } -> Boolean; - { t <= u } -> Boolean; - { t >= u } -> Boolean; - { u < t } -> Boolean; - { u > t } -> Boolean; - { u <= t } -> Boolean; - { u >= t } -> Boolean; + { t < u } -> boolean; + { t > u } -> boolean; + { t <= u } -> boolean; + { t >= u } -> boolean; + { u < t } -> boolean; + { u > t } -> boolean; + { u <= t } -> boolean; + { u >= t } -> boolean; }; \end{codeblock} @@ -4757,11 +4757,12 @@ \tcode{bool(u <= t) == bool(t >= u)} is \tcode{true}. \end{itemize} +\indexlibrary{\idxcode{three_way_comparable}}% \begin{codeblock} template - concept ThreeWayComparable = + concept three_way_comparable = @\placeholder{weakly-equality-comparable-with}@ && - (!ConvertibleTo || @\placeholder{partially-ordered-with}@) && + (!convertible_to || @\placeholder{partially-ordered-with}@) && requires(const remove_reference_t& a, const remove_reference_t& b) { { a <=> b } -> @\placeholder{compares-as}@; }; @@ -4771,7 +4772,7 @@ Let \tcode{a} and \tcode{b} be lvalues of type \tcode{const remove_reference_t}. \tcode{T} and \tcode{Cat} -model \tcode{\libconcept{ThreeWayComparable}} only if: +model \tcode{\libconcept{three_way_comparable}} only if: \begin{itemize} \item \tcode{(a <=> b == 0) == bool(a == b)} is \tcode{true}; @@ -4781,7 +4782,7 @@ \tcode{((a <=> b) <=> 0)} and \tcode{(0 <=> (b <=> a))} are equal; \item if \tcode{Cat} is convertible to \tcode{strong_equality}, \tcode{T} models - \libconcept{EqualityComparable}\iref{concept.equalitycomparable}; + \libconcept{equality_comparable}\iref{concept.equalitycomparable}; \item if \tcode{Cat} is convertible to \tcode{partial_ordering}: \begin{itemize} @@ -4796,18 +4797,19 @@ \end{itemize} \item If \tcode{Cat} is convertible to \tcode{strong_ordering}, \tcode{T} models - \libconcept{StrictTotallyOrdered}\iref{concept.stricttotallyordered}. + \libconcept{totally_ordered}\iref{concept.totallyordered}. \end{itemize} +\indexlibrary{\idxcode{three_way_comparable_with}}% \begin{codeblock} template - concept ThreeWayComparableWith = + concept three_way_comparable_with = @\placeholder{weakly-equality-comparable-with}@ && - (!ConvertibleTo || @\placeholder{partially-ordered-with}@) && - ThreeWayComparable && - ThreeWayComparable && - CommonReference&, const remove_reference_t&> && - ThreeWayComparable< + (!convertible_to || @\placeholder{partially-ordered-with}@) && + three_way_comparable && + three_way_comparable && + common_reference_with&, const remove_reference_t&> && + three_way_comparable< common_reference_t&, const remove_reference_t&>, Cat> && requires(const remove_reference_t& t, const remove_reference_t& u) { { t <=> u } -> @\placeholder{compares-as}@; @@ -4822,7 +4824,7 @@ Let \tcode{C} be \tcode{common_reference_t\&, const remove_reference_t\&>}. \tcode{T}, \tcode{U}, and \tcode{Cat} -model \tcode{\libconcept{ThreeWayComparableWith}} only if: +model \tcode{\libconcept{three_way_comparable_with}} only if: \begin{itemize} \item \tcode{t <=> u} and \tcode{u <=> t} have the same domain; @@ -4837,7 +4839,7 @@ \item if \tcode{Cat} is convertible to \tcode{strong_equality}, \tcode{T} and \tcode{U} model - \tcode{\libconcept{EqualityComparableWith}}\iref{concept.equalitycomparable}; + \tcode{\libconcept{equality_comparable_with}}\iref{concept.equalitycomparable}; \item if \tcode{Cat} is convertible to \tcode{partial_ordering}: \begin{itemize} @@ -4853,7 +4855,7 @@ \item if \tcode{Cat} is convertible to \tcode{strong_ordering}, \tcode{T} and \tcode{U} model - \tcode{\libconcept{StrictTotallyOrderedWith}}\iref{concept.stricttotallyordered}. + \tcode{\libconcept{totally_ordered_with}}\iref{concept.totallyordered}. \end{itemize} \rSec2[cmp.result]{Result of three-way comparison} @@ -4887,10 +4889,11 @@ \end{codeblock} resolves to a built-in operator comparing pointers. +\indexlibrary{\idxcode{compare_three_way}}% \begin{codeblock} struct compare_three_way { template - requires ThreeWayComparableWith || @\placeholdernc{BUILTIN-PTR-THREE-WAY}@(T, U) + requires three_way_comparable_with || @\placeholdernc{BUILTIN-PTR-THREE-WAY}@(T, U) constexpr auto operator()(T&& t, U&& u) const; using is_transparent = @\unspec@; diff --git a/source/templates.tex b/source/templates.tex index 1e8c3c3d42..1682ce7b19 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -3924,7 +3924,7 @@ \begin{codeblock} template concept C = requires(T x) { - { x == x } -> ConvertibleTo; + { x == x } -> convertible_to; }; template diff --git a/source/threads.tex b/source/threads.tex index 169e9c7570..3776e2f49a 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -852,15 +852,15 @@ \mandates \tcode{stop_callback} is instantiated with an argument for the template parameter \tcode{Callback} -that satisfies both \tcode{Invocable} -and \tcode{Destructible}. +that satisfies both \tcode{invocable} +and \tcode{destructible}. \pnum \expects \tcode{stop_callback} is instantiated with an argument for the template parameter \tcode{Callback} -that models both \tcode{Invocable} -and \tcode{Destructible}. +that models both \tcode{invocable} +and \tcode{destructible}. \rSec3[stopcallback.cons]{Constructors and destructor} @@ -877,11 +877,11 @@ \begin{itemdescr} \pnum \constraints -\tcode{Callback} and \tcode{C} satisfy \libconcept{Constructible}. +\tcode{Callback} and \tcode{C} satisfy \libconcept{constructible_from}. \pnum \expects -\tcode{Callback} and \tcode{C} model \libconcept{Constructible}. +\tcode{Callback} and \tcode{C} model \libconcept{constructible_from}. \pnum \effects diff --git a/source/time.tex b/source/time.tex index db94a82ec7..82fbcd6aff 100644 --- a/source/time.tex +++ b/source/time.tex @@ -207,7 +207,7 @@ template constexpr bool operator>=(const time_point& lhs, const time_point& rhs); - template Duration2> + template Duration2> constexpr auto operator<=>(const time_point& lhs, const time_point& rhs); @@ -790,7 +790,7 @@ bool operator>=(const leap& x, const sys_time& y); template bool operator>=(const sys_time& x, const leap& y); - template Duration> + template Duration> auto operator<=>(const leap& x, const sys_time& y); // \ref{time.zone.link}, class \tcode{link} @@ -1701,7 +1701,7 @@ \indexlibrarymember{operator<=>}{duration}% \begin{itemdecl} template - requires ThreeWayComparable + requires three_way_comparable constexpr auto operator<=>(const duration& lhs, const duration& rhs); \end{itemdecl} @@ -2358,7 +2358,7 @@ \indexlibrarymember{operator>=}{time_point}% \begin{itemdecl} template Duration2> + three_way_comparable_with Duration2> constexpr auto operator<=>(const time_point& lhs, const time_point& rhs); \end{itemdecl} @@ -9654,7 +9654,7 @@ \indexlibrarymember{operator<=>}{leap}% \indexlibrarymember{operator<=>}{sys_time}% \begin{itemdecl} -template Duration> +template Duration> constexpr auto operator<=>(const leap& x, const sys_time& y) noexcept; \end{itemdecl} diff --git a/source/utilities.tex b/source/utilities.tex index ab39c0a254..2ff5d761d9 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -1705,7 +1705,7 @@ Given the exposition-only function: \begin{codeblock} template -constexpr T @\placeholdernc{make-from-tuple-impl}@(Tuple&& t, index_sequence) { // exposition only +constexpr T @\placeholdernc{make-from-tuple-impl}@(Tuple&& t, index_sequence) { // \expos return T(get(std::forward(t))...); } \end{codeblock} @@ -2061,7 +2061,7 @@ constexpr bool operator<=(const optional&, const optional&); template constexpr bool operator>=(const optional&, const optional&); - template U> + template U> constexpr compare_three_way_result_t operator<=>(const optional&, const optional&); @@ -2083,7 +2083,7 @@ template constexpr bool operator<=(const T&, const optional&); template constexpr bool operator>=(const optional&, const U&); template constexpr bool operator>=(const T&, const optional&); - template U> + template U> constexpr compare_three_way_result_t operator<=>(const optional&, const U&); @@ -3206,7 +3206,7 @@ \indexlibrarymember{operator<=>}{optional}% \begin{itemdecl} -template U> +template U> constexpr compare_three_way_result_t operator<=>(const optional& x, const optional& y); \end{itemdecl} @@ -3446,7 +3446,7 @@ \indexlibrarymember{operator<=>}{optional}% \begin{itemdecl} -template U> +template U> constexpr compare_three_way_result_t operator<=>(const optional& x, const U& v); \end{itemdecl} @@ -3618,7 +3618,7 @@ constexpr bool operator<=(const variant&, const variant&); template constexpr bool operator>=(const variant&, const variant&); - template requires (ThreeWayComparable && ...) + template requires (three_way_comparable && ...) constexpr common_comparison_category_t...> operator<=>(const variant&, const variant&); @@ -4712,7 +4712,7 @@ \indexlibrarymember{operator<=>}{variant}% \begin{itemdecl} -template requires (ThreeWayComparable && ...) +template requires (three_way_comparable && ...) constexpr common_comparison_category_t...> operator<=>(const variant& v, const variant& w); \end{itemdecl} @@ -6476,14 +6476,14 @@ namespace ranges { template<@\placeholdernc{no-throw-forward-iterator}@ I, @\placeholdernc{no-throw-sentinel}@ S> - requires DefaultConstructible> + requires default_constructible> I uninitialized_default_construct(I first, S last); template<@\placeholdernc{no-throw-forward-range}@ R> - requires DefaultConstructible> + requires default_constructible> safe_iterator_t uninitialized_default_construct(R&& r); template<@\placeholdernc{no-throw-forward-iterator}@ I> - requires DefaultConstructible> + requires default_constructible> I uninitialized_default_construct_n(I first, iter_difference_t n); } @@ -6500,14 +6500,14 @@ namespace ranges { template<@\placeholdernc{no-throw-forward-iterator}@ I, @\placeholdernc{no-throw-sentinel}@ S> - requires DefaultConstructible> + requires default_constructible> I uninitialized_value_construct(I first, S last); template<@\placeholdernc{no-throw-forward-range}@ R> - requires DefaultConstructible> + requires default_constructible> safe_iterator_t uninitialized_value_construct(R&& r); template<@\placeholdernc{no-throw-forward-iterator}@ I> - requires DefaultConstructible> + requires default_constructible> I uninitialized_value_construct_n(I first, iter_difference_t n); } @@ -6529,20 +6529,20 @@ namespace ranges { template using uninitialized_copy_result = copy_result; - template S1, + template S1, @\placeholdernc{no-throw-forward-iterator}@ O, @\placeholdernc{no-throw-sentinel}@ S2> - requires Constructible, iter_reference_t> + requires constructible_from, iter_reference_t> uninitialized_copy_result uninitialized_copy(I ifirst, S1 ilast, O ofirst, S2 olast); - template - requires Constructible, range_reference_t> + template + requires constructible_from, range_reference_t> uninitialized_copy_result, safe_iterator_t> - uninitialized_copy(IR&& input_range, OR&& output_range); + uninitialized_copy(IR&& in_range, OR&& out_range); template using uninitialized_copy_n_result = uninitialized_copy_result; - template S> - requires Constructible, iter_reference_t> + template S> + requires constructible_from, iter_reference_t> uninitialized_copy_n_result uninitialized_copy_n(I ifirst, iter_difference_t n, O ofirst, S olast); } @@ -6565,21 +6565,21 @@ namespace ranges { template using uninitialized_move_result = uninitialized_copy_result; - template S1, + template S1, @\placeholdernc{no-throw-forward-iterator}@ O, @\placeholdernc{no-throw-sentinel}@ S2> - requires Constructible, iter_rvalue_reference_t> + requires constructible_from, iter_rvalue_reference_t> uninitialized_move_result uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast); - template - requires Constructible, range_rvalue_reference_t> + template + requires constructible_from, range_rvalue_reference_t> uninitialized_move_result, safe_iterator_t> - uninitialized_move(IR&& input_range, OR&& output_range); + uninitialized_move(IR&& in_range, OR&& out_range); template using uninitialized_move_n_result = uninitialized_copy_result; - template S> - requires Constructible, iter_rvalue_reference_t> + requires constructible_from, iter_rvalue_reference_t> uninitialized_move_n_result uninitialized_move_n(I ifirst, iter_difference_t n, O ofirst, S olast); } @@ -6597,14 +6597,14 @@ namespace ranges { template<@\placeholdernc{no-throw-forward-iterator}@ I, @\placeholdernc{no-throw-sentinel}@ S, class T> - requires Constructible, const T&> + requires constructible_from, const T&> I uninitialized_fill(I first, S last, const T& x); template<@\placeholdernc{no-throw-forward-range}@ R, class T> - requires Constructible, const T&> + requires constructible_from, const T&> safe_iterator_t uninitialized_fill(R&& r, const T& x); template<@\placeholdernc{no-throw-forward-iterator}@ I, class T> - requires Constructible, const T&> + requires constructible_from, const T&> I uninitialized_fill_n(I first, iter_difference_t n, const T& x); } @@ -6632,18 +6632,18 @@ ForwardIterator first, Size n); namespace ranges { - template + template constexpr void destroy_at(T* location) noexcept; template<@\placeholdernc{no-throw-input-iterator}@ I, @\placeholdernc{no-throw-sentinel}@ S> - requires Destructible> + requires destructible> constexpr I destroy(I first, S last) noexcept; template<@\placeholdernc{no-throw-input-range}@ R> - requires Destructible> + requires destructible> constexpr safe_iterator_t destroy(R&& r) noexcept; template<@\placeholdernc{no-throw-input-iterator}@ I> - requires Destructible> + requires destructible> constexpr I destroy_n(I first, iter_difference_t n) noexcept; } @@ -6681,8 +6681,8 @@ template bool operator>=(const unique_ptr& x, const unique_ptr& y); template - requires ThreeWayComparableWith::pointer, - typename unique_ptr::pointer> + requires three_way_comparable_with::pointer, + typename unique_ptr::pointer> compare_three_way_result_t::pointer, typename unique_ptr::pointer> operator<=>(const unique_ptr& x, const unique_ptr& y); @@ -6706,7 +6706,7 @@ template bool operator>=(nullptr_t, const unique_ptr& y); template - requires ThreeWayComparableWith::pointer, nullptr_t> + requires three_way_comparable_with::pointer, nullptr_t> compare_three_way_result_t::pointer, nullptr_t> operator<=>(const unique_ptr& x, nullptr_t); @@ -7886,9 +7886,9 @@ unqualified\iref{basic.lookup.unqual} name lookup for the \grammarterm{postfix-expression} in a function call\iref{expr.call}, they inhibit argument-dependent name lookup. -\item Overloads of algorithms that take \libconcept{Range} arguments\iref{range.range} +\item Overloads of algorithms that take \libconcept{range} arguments\iref{range.range} behave as if they are implemented by calling \tcode{ranges::begin} - and \tcode{ranges::end} on the \libconcept{Range}(s) and dispatching to the + and \tcode{ranges::end} on the \libconcept{range}(s) and dispatching to the overload that takes separate iterator and sentinel arguments. \item The number and order of deducible template parameters for algorithm declarations is unspecified, except where explicitly stated otherwise. @@ -7924,10 +7924,10 @@ \begin{itemdecl} template -concept @\placeholdernc{no-throw-input-iterator}@ = // exposition only - InputIterator && +concept @\placeholdernc{no-throw-input-iterator}@ = // \expos + input_iterator && is_lvalue_reference_v> && - Same>, iter_value_t>; + same_as>, iter_value_t>; \end{itemdecl} \begin{itemdescr} @@ -7940,14 +7940,14 @@ \pnum \begin{note} -This concept allows some \tcode{InputIterator}\iref{iterator.concept.input} +This concept allows some \libconcept{input_iterator}\iref{iterator.concept.input} operations to throw exceptions. \end{note} \end{itemdescr} \begin{itemdecl} template -concept @\placeholdernc{no-throw-sentinel}@ = Sentinel; // exposition only +concept @\placeholdernc{no-throw-sentinel}@ = sentinel_for; // \expos \end{itemdecl} \begin{itemdescr} @@ -7959,15 +7959,15 @@ \pnum \begin{note} -This concept allows some \tcode{Sentinel}\iref{iterator.concept.sentinel} +This concept allows some \libconcept{sentinel_for}\iref{iterator.concept.sentinel} operations to throw exceptions. \end{note} \end{itemdescr} \begin{itemdecl} template -concept @\placeholdernc{no-throw-input-range}@ = // exposition only - Range && +concept @\placeholdernc{no-throw-input-range}@ = // \expos + range && @\placeholder{no-throw-input-iterator}@> && @\placeholdernc{no-throw-sentinel}@, iterator_t>; \end{itemdecl} @@ -7981,23 +7981,23 @@ \begin{itemdecl} template -concept @\placeholdernc{no-throw-forward-iterator}@ = // exposition only +concept @\placeholdernc{no-throw-forward-iterator}@ = // \expos @\placeholder{no-throw-input-iterator}@ && - ForwardIterator && + forward_iterator && @\placeholdernc{no-throw-sentinel}@; \end{itemdecl} \begin{itemdescr} \pnum \begin{note} -This concept allows some \tcode{ForwardIterator}\iref{iterator.concept.forward} +This concept allows some \libconcept{forward_iterator}\iref{iterator.concept.forward} operations to throw exceptions. \end{note} \end{itemdescr} \begin{itemdecl} template -concept @\placeholdernc{no-throw-forward-range}@ = // exposition only +concept @\placeholdernc{no-throw-forward-range}@ = // \expos @\placeholder{no-throw-input-range}@ && @\placeholder{no-throw-forward-iterator}@>; \end{itemdecl} @@ -8043,10 +8043,10 @@ \begin{itemdecl} namespace ranges { template<@\placeholdernc{no-throw-forward-iterator}@ I, @\placeholdernc{no-throw-sentinel}@ S> - requires DefaultConstructible> + requires default_constructible> I uninitialized_default_construct(I first, S last); template<@\placeholdernc{no-throw-forward-range}@ R> - requires DefaultConstructible> + requires default_constructible> safe_iterator_t uninitialized_default_construct(R&& r); } \end{itemdecl} @@ -8083,7 +8083,7 @@ \begin{itemdecl} namespace ranges { template<@\placeholdernc{no-throw-forward-iterator}@ I> - requires DefaultConstructible> + requires default_constructible> I uninitialized_default_construct_n(I first, iter_difference_t n); } \end{itemdecl} @@ -8120,10 +8120,10 @@ \begin{itemdecl} namespace ranges { template<@\placeholdernc{no-throw-forward-iterator}@ I, @\placeholdernc{no-throw-sentinel}@ S> - requires DefaultConstructible> + requires default_constructible> I uninitialized_value_construct(I first, S last); template<@\placeholdernc{no-throw-forward-range}@ R> - requires DefaultConstructible> + requires default_constructible> safe_iterator_t uninitialized_value_construct(R&& r); } \end{itemdecl} @@ -8160,7 +8160,7 @@ \begin{itemdecl} namespace ranges { template<@\placeholdernc{no-throw-forward-iterator}@ I> - requires DefaultConstructible> + requires default_constructible> I uninitialized_value_construct_n(I first, iter_difference_t n); } \end{itemdecl} @@ -8205,15 +8205,15 @@ \indexlibrary{\idxcode{uninitialized_copy}}% \begin{itemdecl} namespace ranges { - template S1, + template S1, @\placeholdernc{no-throw-forward-iterator}@ O, @\placeholdernc{no-throw-sentinel}@ S2> - requires Constructible, iter_reference_t> + requires constructible_from, iter_reference_t> uninitialized_copy_result uninitialized_copy(I ifirst, S1 ilast, O ofirst, S2 olast); - template - requires Constructible, range_reference_t> + template + requires constructible_from, range_reference_t> uninitialized_copy_result, safe_iterator_t> - uninitialized_copy(IR&& input_range, OR&& output_range); + uninitialized_copy(IR&& in_range, OR&& out_range); } \end{itemdecl} @@ -8260,8 +8260,8 @@ \indexlibrary{\idxcode{uninitialized_copy_n}}% \begin{itemdecl} namespace ranges { - template S> - requires Constructible, iter_reference_t> + template S> + requires constructible_from, iter_reference_t> uninitialized_copy_n_result uninitialized_copy_n(I ifirst, iter_difference_t n, O ofirst, S olast); } @@ -8310,15 +8310,15 @@ \indexlibrary{\idxcode{uninitialized_move}}% \begin{itemdecl} namespace ranges { - template S1, + template S1, @\placeholdernc{no-throw-forward-iterator}@ O, @\placeholdernc{no-throw-sentinel}@ S2> - requires Constructible, iter_rvalue_reference_t> + requires constructible_from, iter_rvalue_reference_t> uninitialized_move_result uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast); - template - requires Constructible, range_rvalue_reference_t> + template + requires constructible_from, range_rvalue_reference_t> uninitialized_move_result, safe_iterator_t> - uninitialized_move(IR&& input_range, OR&& output_range); + uninitialized_move(IR&& in_range, OR&& out_range); } \end{itemdecl} @@ -8370,8 +8370,8 @@ \indexlibrary{\idxcode{uninitialized_move_n}}% \begin{itemdecl} namespace ranges { - template S> - requires Constructible, iter_rvalue_reference_t> + template S> + requires constructible_from, iter_rvalue_reference_t> uninitialized_move_n_result uninitialized_move_n(I ifirst, iter_difference_t n, O ofirst, S olast); } @@ -8422,10 +8422,10 @@ \begin{itemdecl} namespace ranges { template<@\placeholdernc{no-throw-forward-iterator}@ I, @\placeholdernc{no-throw-sentinel}@ S, class T> - requires Constructible, const T&> + requires constructible_from, const T&> I uninitialized_fill(I first, S last, const T& x); template<@\placeholdernc{no-throw-forward-range}@ R, class T> - requires Constructible, const T&> + requires constructible_from, const T&> safe_iterator_t uninitialized_fill(R&& r, const T& x); } \end{itemdecl} @@ -8462,7 +8462,7 @@ \begin{itemdecl} namespace ranges { template<@\placeholdernc{no-throw-forward-iterator}@ I, class T> - requires Constructible, const T&> + requires constructible_from, const T&> I uninitialized_fill_n(I first, iter_difference_t n, const T& x); } \end{itemdecl} @@ -8509,7 +8509,7 @@ template constexpr void destroy_at(T* location); namespace ranges { - template + template constexpr void destroy_at(T* location) noexcept; } \end{itemdecl} @@ -8545,10 +8545,10 @@ \begin{itemdecl} namespace ranges { template<@\placeholdernc{no-throw-input-iterator}@ I, @\placeholdernc{no-throw-sentinel}@ S> - requires Destructible> + requires destructible> constexpr I destroy(I first, S last) noexcept; template<@\placeholdernc{no-throw-input-range}@ R> - requires Destructible> + requires destructible> constexpr safe_iterator_t destroy(R&& r) noexcept; } \end{itemdecl} @@ -8584,7 +8584,7 @@ \begin{itemdecl} namespace ranges { template<@\placeholdernc{no-throw-input-iterator}@ I> - requires Destructible> + requires destructible> constexpr I destroy_n(I first, iter_difference_t n) noexcept; } \end{itemdecl} @@ -9675,8 +9675,8 @@ \indexlibrarymember{operator<=>}{unique_ptr}% \begin{itemdecl} template - requires ThreeWayComparableWith::pointer, - typename unique_ptr::pointer> + requires three_way_comparable_with::pointer, + typename unique_ptr::pointer> compare_three_way_result_t::pointer, typename unique_ptr::pointer> operator<=>(const unique_ptr& x, const unique_ptr& y); @@ -9773,7 +9773,7 @@ \indexlibrarymember{operator<=>}{unique_ptr}% \begin{itemdecl} template - requires ThreeWayComparableWith::pointer, nullptr_t> + requires three_way_comparable_with::pointer, nullptr_t> compare_three_way_result_t::pointer, nullptr_t> operator<=>(const unique_ptr& x, nullptr_t); \end{itemdecl} @@ -14675,7 +14675,7 @@ \begin{itemdecl} struct ranges::equal_to { template - requires EqualityComparableWith || @\placeholdernc{BUILTIN-PTR-CMP}@(T, ==, U) + requires equality_comparable_with || @\placeholdernc{BUILTIN-PTR-CMP}@(T, ==, U) constexpr bool operator()(T&& t, U&& u) const; using is_transparent = @\unspecnc@; @@ -14710,7 +14710,7 @@ \begin{itemdecl} struct ranges::not_equal_to { template - requires EqualityComparableWith || @\placeholdernc{BUILTIN-PTR-CMP}@(T, ==, U) + requires equality_comparable_with || @\placeholdernc{BUILTIN-PTR-CMP}@(T, ==, U) constexpr bool operator()(T&& t, U&& u) const; using is_transparent = @\unspecnc@; @@ -14729,7 +14729,7 @@ \begin{itemdecl} struct ranges::greater { template - requires StrictTotallyOrderedWith || @\placeholdernc{BUILTIN-PTR-CMP}@(U, <, T) + requires totally_ordered_with || @\placeholdernc{BUILTIN-PTR-CMP}@(U, <, T) constexpr bool operator()(T&& t, U&& u) const; using is_transparent = @\unspecnc@; @@ -14748,7 +14748,7 @@ \begin{itemdecl} struct ranges::less { template - requires StrictTotallyOrderedWith || @\placeholdernc{BUILTIN-PTR-CMP}@(T, <, U) + requires totally_ordered_with || @\placeholdernc{BUILTIN-PTR-CMP}@(T, <, U) constexpr bool operator()(T&& t, U&& u) const; using is_transparent = @\unspecnc@; @@ -14789,7 +14789,7 @@ \begin{itemdecl} struct ranges::greater_equal { template - requires StrictTotallyOrderedWith || @\placeholdernc{BUILTIN-PTR-CMP}@(T, <, U) + requires totally_ordered_with || @\placeholdernc{BUILTIN-PTR-CMP}@(T, <, U) constexpr bool operator()(T&& t, U&& u) const; using is_transparent = @\unspecnc@; @@ -14808,7 +14808,7 @@ \begin{itemdecl} struct ranges::less_equal { template - requires StrictTotallyOrderedWith || @\placeholdernc{BUILTIN-PTR-CMP}@(U, <, T) + requires totally_ordered_with || @\placeholdernc{BUILTIN-PTR-CMP}@(U, <, T) constexpr bool operator()(T&& t, U&& u) const; using is_transparent = @\unspecnc@; @@ -20233,11 +20233,11 @@ \pnum \constraints -\tcode{Out} satisfies \tcode{OutputIterator}. +\tcode{Out} satisfies \tcode{output_iterator}. \pnum \expects -\tcode{Out} models \tcode{OutputIterator}. +\tcode{Out} models \tcode{output_iterator}. \pnum \effects @@ -20290,11 +20290,11 @@ \pnum \constraints -\tcode{Out} satisfies \tcode{OutputIterator}. +\tcode{Out} satisfies \tcode{output_iterator}. \pnum \expects -\tcode{Out} models \tcode{OutputIterator}, and +\tcode{Out} models \tcode{output_iterator}, and \tcode{formatter<}$\tcode{T}_i$\tcode{, charT>} meets the \newoldconcept{Formatter} requirements\iref{formatter.requirements} for each $\tcode{T}_i$ in \tcode{Args}. @@ -20738,7 +20738,7 @@ consisting of the formatting arguments and the output iterator. \pnum -\tcode{Out} shall model \tcode{OutputIterator}. +\tcode{Out} shall model \tcode{output_iterator}. \pnum \indexlibrary{\idxcode{format_context}}%