diff --git a/include/stl2/detail/algorithm/adjacent_find.hpp b/include/stl2/detail/algorithm/adjacent_find.hpp index 579dd7e46..8f277b638 100644 --- a/include/stl2/detail/algorithm/adjacent_find.hpp +++ b/include/stl2/detail/algorithm/adjacent_find.hpp @@ -25,8 +25,8 @@ STL2_OPEN_NAMESPACE { template S, class Pred = equal_to<>, class Proj = identity> requires - models::IndirectRelation< - Pred, projected> + IndirectRelation< + Pred, projected>() I adjacent_find(I first, S last, Pred pred = Pred{}, Proj proj = Proj{}) { if (first == last) { @@ -44,8 +44,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectRelation< - Pred, projected, Proj>> + IndirectRelation< + Pred, projected, Proj>>() safe_iterator_t adjacent_find(Rng&& rng, Pred pred = Pred{}, Proj proj = Proj{}) { @@ -57,8 +57,8 @@ STL2_OPEN_NAMESPACE { // Extension template , class Proj = identity> requires - models::IndirectRelation< - Pred, projected> + IndirectRelation< + Pred, projected>() dangling adjacent_find(std::initializer_list&& rng, Pred pred = Pred{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/all_of.hpp b/include/stl2/detail/algorithm/all_of.hpp index 506d67510..b3fcc2048 100644 --- a/include/stl2/detail/algorithm/all_of.hpp +++ b/include/stl2/detail/algorithm/all_of.hpp @@ -27,8 +27,8 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class Proj = identity> requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() bool all_of(I first, S last, Pred pred, Proj proj = Proj{}) { if (first != last) { @@ -43,8 +43,8 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectPredicate< - Pred, projected, Proj>> + IndirectPredicate< + Pred, projected, Proj>>() bool all_of(R&& rng, Pred pred, Proj proj = Proj{}) { return __stl2::all_of(__stl2::begin(rng), __stl2::end(rng), @@ -54,8 +54,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() bool all_of(std::initializer_list il, Pred pred, Proj proj = Proj{}) { return __stl2::all_of(il.begin(), il.end(), diff --git a/include/stl2/detail/algorithm/any_of.hpp b/include/stl2/detail/algorithm/any_of.hpp index 84df54fef..59fc5eebf 100644 --- a/include/stl2/detail/algorithm/any_of.hpp +++ b/include/stl2/detail/algorithm/any_of.hpp @@ -26,8 +26,8 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class Proj = identity> requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() bool any_of(I first, S last, Pred pred, Proj proj = Proj{}) { if (first != last) { @@ -42,8 +42,8 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectPredicate< - Pred, projected, Proj>> + IndirectPredicate< + Pred, projected, Proj>>() bool any_of(R&& rng, Pred pred, Proj proj = Proj{}) { return __stl2::any_of(__stl2::begin(rng), __stl2::end(rng), @@ -53,8 +53,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() bool any_of(std::initializer_list il, Pred pred, Proj proj = Proj{}) { return __stl2::any_of(il.begin(), il.end(), diff --git a/include/stl2/detail/algorithm/binary_search.hpp b/include/stl2/detail/algorithm/binary_search.hpp index cf59f0f0d..9a537b9cf 100644 --- a/include/stl2/detail/algorithm/binary_search.hpp +++ b/include/stl2/detail/algorithm/binary_search.hpp @@ -25,8 +25,8 @@ STL2_OPEN_NAMESPACE { template S, class T, class Comp = less<>, class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, const T*, projected> + IndirectStrictWeakOrder< + Comp, const T*, projected>() bool binary_search(I first, S last, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -37,8 +37,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, const T*, projected, Proj>> + IndirectStrictWeakOrder< + Comp, const T*, projected, Proj>>() bool binary_search(Rng&& rng, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { return __stl2::binary_search( @@ -49,8 +49,8 @@ STL2_OPEN_NAMESPACE { // Extension template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, const T*, projected> + IndirectStrictWeakOrder< + Comp, const T*, projected>() bool binary_search(std::initializer_list&& rng, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/copy.hpp b/include/stl2/detail/algorithm/copy.hpp index 82bb9d01b..c02f389de 100644 --- a/include/stl2/detail/algorithm/copy.hpp +++ b/include/stl2/detail/algorithm/copy.hpp @@ -22,7 +22,7 @@ STL2_OPEN_NAMESPACE { template S, WeaklyIncrementable O> requires - models::IndirectlyCopyable + IndirectlyCopyable() tagged_pair copy(I first, S last, O result) { @@ -34,8 +34,8 @@ STL2_OPEN_NAMESPACE { template requires - models::WeaklyIncrementable<__f> && - models::IndirectlyCopyable, __f> + WeaklyIncrementable<__f>() && + IndirectlyCopyable, __f>() tagged_pair), tag::out(__f)> copy(Rng&& rng, O&& result) { @@ -46,8 +46,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::WeaklyIncrementable<__f> && - models::IndirectlyCopyable> + WeaklyIncrementable<__f>() && + IndirectlyCopyable>() tagged_pair), tag::out(__f)> copy(std::initializer_list&& rng, O&& result) { @@ -58,7 +58,7 @@ STL2_OPEN_NAMESPACE { namespace ext { template S1, Iterator I2, Sentinel S2> requires - models::IndirectlyCopyable + IndirectlyCopyable() tagged_pair copy(I1 first, S1 last, I2 result_first, S2 result_last) { @@ -70,7 +70,7 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectlyCopyable, iterator_t> + IndirectlyCopyable, iterator_t>() tagged_pair), tag::out(safe_iterator_t)> copy(Rng1&& rng1, Rng2&& rng2) { @@ -80,7 +80,7 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectlyCopyable> + IndirectlyCopyable>() tagged_pair), tag::out(safe_iterator_t)> copy(std::initializer_list&& rng1, Rng2&& rng2) { diff --git a/include/stl2/detail/algorithm/copy_backward.hpp b/include/stl2/detail/algorithm/copy_backward.hpp index 63a69e7ff..831af8fc1 100644 --- a/include/stl2/detail/algorithm/copy_backward.hpp +++ b/include/stl2/detail/algorithm/copy_backward.hpp @@ -24,7 +24,7 @@ STL2_OPEN_NAMESPACE { template S1, BidirectionalIterator I2> requires - models::IndirectlyCopyable + IndirectlyCopyable() tagged_pair copy_backward(I1 first, S1 sent, I2 out) { @@ -38,8 +38,8 @@ STL2_OPEN_NAMESPACE { template requires - models::BidirectionalIterator<__f> && - models::IndirectlyCopyable, __f> + BidirectionalIterator<__f>() && + IndirectlyCopyable, __f>() tagged_pair), tag::out(__f)> copy_backward(Rng&& rng, I&& result) { @@ -51,8 +51,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::BidirectionalIterator<__f> && - models::IndirectlyCopyable> + BidirectionalIterator<__f>() && + IndirectlyCopyable>() tagged_pair), tag::out(__f)> copy_backward(std::initializer_list&& rng, I&& result) { diff --git a/include/stl2/detail/algorithm/copy_if.hpp b/include/stl2/detail/algorithm/copy_if.hpp index d820c16fd..7499625fe 100644 --- a/include/stl2/detail/algorithm/copy_if.hpp +++ b/include/stl2/detail/algorithm/copy_if.hpp @@ -26,9 +26,9 @@ STL2_OPEN_NAMESPACE { template S, WeaklyIncrementable O, class Pred, class Proj = identity> requires - models::IndirectlyCopyable && - models::IndirectPredicate< - Pred, projected> + IndirectlyCopyable() && + IndirectPredicate< + Pred, projected>() tagged_pair copy_if(I first, S last, O result, Pred pred, Proj proj = Proj{}) { @@ -45,10 +45,10 @@ STL2_OPEN_NAMESPACE { template requires - models::WeaklyIncrementable<__f> && - models::IndirectPredicate< - Pred, projected, Proj>> && - models::IndirectlyCopyable, __f> + WeaklyIncrementable<__f>() && + IndirectPredicate< + Pred, projected, Proj>>() && + IndirectlyCopyable, __f>() tagged_pair), tag::out(__f)> copy_if(Rng&& rng, O&& result, Pred pred, Proj proj = Proj{}) { @@ -60,10 +60,10 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::WeaklyIncrementable<__f> && - models::IndirectPredicate< - Pred, projected> && - models::IndirectlyCopyable> + WeaklyIncrementable<__f>() && + IndirectPredicate< + Pred, projected>() && + IndirectlyCopyable>() tagged_pair), tag::out(__f)> copy_if(std::initializer_list&& rng, O&& result, Pred pred, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/copy_n.hpp b/include/stl2/detail/algorithm/copy_n.hpp index 01422cf88..2ef987b46 100644 --- a/include/stl2/detail/algorithm/copy_n.hpp +++ b/include/stl2/detail/algorithm/copy_n.hpp @@ -22,7 +22,7 @@ // STL2_OPEN_NAMESPACE { template - requires models::IndirectlyCopyable + requires IndirectlyCopyable() tagged_pair copy_n(I first_, difference_type_t n, O result) { diff --git a/include/stl2/detail/algorithm/count.hpp b/include/stl2/detail/algorithm/count.hpp index 413d5f210..656eccdd2 100644 --- a/include/stl2/detail/algorithm/count.hpp +++ b/include/stl2/detail/algorithm/count.hpp @@ -23,8 +23,8 @@ STL2_OPEN_NAMESPACE { template S, class T, class Proj = identity> requires - models::IndirectRelation< - equal_to<>, projected, const T*> + IndirectRelation< + equal_to<>, projected, const T*>() difference_type_t count(I first, S last, const T& value, Proj proj = Proj{}) { @@ -39,8 +39,8 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectRelation< - equal_to<>, projected, Proj>, const T*> + IndirectRelation< + equal_to<>, projected, Proj>, const T*>() difference_type_t> count(Rng&& rng, const T& value, Proj proj = Proj{}) { @@ -51,8 +51,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::IndirectRelation< - equal_to<>, projected, const T*> + IndirectRelation< + equal_to<>, projected, const T*>() std::ptrdiff_t count(std::initializer_list&& rng, const T& value, Proj proj = Proj{}) diff --git a/include/stl2/detail/algorithm/count_if.hpp b/include/stl2/detail/algorithm/count_if.hpp index 899eaa23f..b78feef49 100644 --- a/include/stl2/detail/algorithm/count_if.hpp +++ b/include/stl2/detail/algorithm/count_if.hpp @@ -23,8 +23,8 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class Proj = identity> requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() difference_type_t count_if(I first, S last, Pred pred, Proj proj = Proj{}) { auto n = difference_type_t{0}; @@ -38,8 +38,8 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectPredicate< - Pred, projected, Proj>> + IndirectPredicate< + Pred, projected, Proj>>() difference_type_t> count_if(Rng&& rng, Pred pred, Proj proj = Proj{}) { return __stl2::count_if(__stl2::begin(rng), __stl2::end(rng), @@ -48,8 +48,8 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() std::ptrdiff_t count_if(std::initializer_list&& rng, Pred pred, Proj proj = Proj{}) { return __stl2::count_if(rng, __stl2::ref(pred), __stl2::ref(proj)); diff --git a/include/stl2/detail/algorithm/equal.hpp b/include/stl2/detail/algorithm/equal.hpp index 477d6b44e..539efdce4 100644 --- a/include/stl2/detail/algorithm/equal.hpp +++ b/include/stl2/detail/algorithm/equal.hpp @@ -24,7 +24,7 @@ STL2_OPEN_NAMESPACE { template S1, InputIterator I2, class Pred, class Proj1, class Proj2> requires - models::IndirectlyComparable + IndirectlyComparable() bool __equal_3(I1 first1, S1 last1, I2 first2, Pred& pred, Proj1& proj1, Proj2& proj2) { @@ -40,7 +40,7 @@ STL2_OPEN_NAMESPACE { InputIterator I2, Sentinel S2, class Pred, class Proj1, class Proj2> requires - models::IndirectlyComparable + IndirectlyComparable() bool __equal_4(I1 first1, S1 last1, I2 first2, S2 last2, Pred& pred, Proj1& proj1, Proj2& proj2) { @@ -58,11 +58,11 @@ STL2_OPEN_NAMESPACE { equal(I1&& first1, S1&& last1, I2&& first2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) requires - models::InputIterator<__f> && - models::Sentinel<__f, __f> && - models::InputIterator<__f> && - models::IndirectlyComparable< - __f, __f, Pred, Proj1, Proj2> + InputIterator<__f>() && + Sentinel<__f, __f>() && + InputIterator<__f>() && + IndirectlyComparable< + __f, __f, Pred, Proj1, Proj2>() { return __stl2::__equal_3( __stl2::forward(first1), __stl2::forward(last1), @@ -75,9 +75,9 @@ STL2_OPEN_NAMESPACE { Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) requires !is_array>::value && - models::InputIterator<__f> && - models::IndirectlyComparable< - iterator_t, __f, Pred, Proj1, Proj2> + InputIterator<__f>() && + IndirectlyComparable< + iterator_t, __f, Pred, Proj1, Proj2>() { auto first2 = std::forward(first2_); return __stl2::__equal_3(__stl2::begin(rng1), __stl2::end(rng1), @@ -87,12 +87,12 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::InputIterator<__f> && - models::InputIterator<__f> && + InputIterator<__f>() && + InputIterator<__f>() && Sentinel<__f, __f>() && Sentinel<__f, __f>() && - models::IndirectlyComparable< - __f, __f, Pred, Proj1, Proj2> + IndirectlyComparable< + __f, __f, Pred, Proj1, Proj2>() bool equal(I1&& first1, S1&& last1, I2&& first2, S2&& last2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -105,12 +105,12 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::InputIterator<__f> && - models::InputIterator<__f> && + InputIterator<__f>() && + InputIterator<__f>() && SizedSentinel<__f, __f>() && SizedSentinel<__f, __f>() && - models::IndirectlyComparable< - __f, __f, Pred, Proj1, Proj2> + IndirectlyComparable< + __f, __f, Pred, Proj1, Proj2>() bool equal(I1&& first1_, S1&& last1_, I2&& first2_, S2&& last2_, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -133,9 +133,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectlyComparable< + IndirectlyComparable< iterator_t, iterator_t, - Pred, Proj1, Proj2> + Pred, Proj1, Proj2>() bool equal(Rng1&& rng1, Rng2&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -148,10 +148,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::SizedRange && models::SizedRange && - models::IndirectlyComparable< + SizedRange() && SizedRange() && + IndirectlyComparable< iterator_t, iterator_t, - Pred, Proj1, Proj2> + Pred, Proj1, Proj2>() bool equal(Rng1&& rng1, Rng2&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { diff --git a/include/stl2/detail/algorithm/equal_range.hpp b/include/stl2/detail/algorithm/equal_range.hpp index cbac29cd4..22d6912fa 100644 --- a/include/stl2/detail/algorithm/equal_range.hpp +++ b/include/stl2/detail/algorithm/equal_range.hpp @@ -27,8 +27,8 @@ STL2_OPEN_NAMESPACE { namespace ext { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, const T*, projected> + IndirectStrictWeakOrder< + Comp, const T*, projected>() ext::range equal_range_n(I first, difference_type_t dist, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -63,8 +63,8 @@ STL2_OPEN_NAMESPACE { template S, class T, class Comp = less<>, class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, const T*, projected> + IndirectStrictWeakOrder< + Comp, const T*, projected>() ext::range equal_range(I first, S last, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -109,8 +109,8 @@ STL2_OPEN_NAMESPACE { template S, class T, class Comp = less<>, class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, const T*, projected> + IndirectStrictWeakOrder< + Comp, const T*, projected>() ext::range equal_range(I first, S last, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -122,8 +122,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, const T*, projected, Proj>> + IndirectStrictWeakOrder< + Comp, const T*, projected, Proj>>() ext::range> equal_range(Rng&& rng, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -135,9 +135,9 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, const T*, projected, Proj>> && - models::SizedRange + IndirectStrictWeakOrder< + Comp, const T*, projected, Proj>>() && + SizedRange() ext::range> equal_range(Rng&& rng, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -149,8 +149,8 @@ STL2_OPEN_NAMESPACE { // Extension template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, const T*, projected> + IndirectStrictWeakOrder< + Comp, const T*, projected>() ext::range> equal_range(std::initializer_list&& rng, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) diff --git a/include/stl2/detail/algorithm/find.hpp b/include/stl2/detail/algorithm/find.hpp index 16e9abc71..299f1ff40 100644 --- a/include/stl2/detail/algorithm/find.hpp +++ b/include/stl2/detail/algorithm/find.hpp @@ -24,8 +24,8 @@ STL2_OPEN_NAMESPACE { template S, class T, class Proj = identity> requires - models::IndirectRelation< - equal_to<>, projected, const T*> + IndirectRelation< + equal_to<>, projected, const T*>() I find(I first, S last, const T& value, Proj proj = Proj{}) { for (; first != last; ++first) { @@ -38,8 +38,8 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectRelation< - equal_to<>, projected, Proj>, const T*> + IndirectRelation< + equal_to<>, projected, Proj>, const T*>() safe_iterator_t find(Rng&& rng, const T& value, Proj proj = Proj{}) { return __stl2::find(__stl2::begin(rng), __stl2::end(rng), value, __stl2::ref(proj)); @@ -48,8 +48,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::IndirectRelation< - equal_to<>, projected, const T*> + IndirectRelation< + equal_to<>, projected, const T*>() dangling find(std::initializer_list&& il, const T& value, Proj proj = Proj{}) { return __stl2::find(il.begin(), il.end(), value, __stl2::ref(proj)); diff --git a/include/stl2/detail/algorithm/find_end.hpp b/include/stl2/detail/algorithm/find_end.hpp index 76d7ec63d..76b93b151 100644 --- a/include/stl2/detail/algorithm/find_end.hpp +++ b/include/stl2/detail/algorithm/find_end.hpp @@ -28,8 +28,8 @@ STL2_OPEN_NAMESPACE { ForwardIterator I2, Sentinel S2, class Pred = equal_to<>, class Proj = identity> requires - models::IndirectRelation< - Pred, I2, projected> + IndirectRelation< + Pred, I2, projected>() I1 find_end(I1 first1, const S1 last1, const I2 first2, const S2 last2, Pred pred = Pred{}, Proj proj = Proj{}) @@ -60,8 +60,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectRelation< - Pred, I2, projected> + IndirectRelation< + Pred, I2, projected>() I1 find_end(I1 first1, I1 last1, I2 first2, I2 last2, Pred pred = Pred{}, Proj proj = Proj{}) { @@ -92,8 +92,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectRelation< - Pred, I2, projected> + IndirectRelation< + Pred, I2, projected>() I1 find_end(I1 first1, I1 last1, I2 first2, I2 last2, Pred pred = Pred{}, Proj proj = Proj{}) { @@ -123,8 +123,8 @@ STL2_OPEN_NAMESPACE { BidirectionalIterator I2, Sentinel S2, class Pred = equal_to<>, class Proj = identity> requires - models::IndirectRelation< - Pred, I2, projected> + IndirectRelation< + Pred, I2, projected>() I1 find_end(I1 first1, S1 s1, I2 first2, S2 s2, Pred pred = Pred{}, Proj proj = Proj{}) { auto last1 = __stl2::next(first1, __stl2::move(s1)); @@ -138,8 +138,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectRelation< - Pred, iterator_t, projected, Proj>> + IndirectRelation< + Pred, iterator_t, projected, Proj>>() safe_iterator_t find_end(Rng1&& rng1, Rng2&& rng2, Pred pred = Pred{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/find_first_of.hpp b/include/stl2/detail/algorithm/find_first_of.hpp index 5a1889c0c..2b3556527 100644 --- a/include/stl2/detail/algorithm/find_first_of.hpp +++ b/include/stl2/detail/algorithm/find_first_of.hpp @@ -26,9 +26,9 @@ STL2_OPEN_NAMESPACE { class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> requires - models::IndirectPredicate, - projected> + projected>() I1 find_first_of(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -46,9 +46,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectPredicate, Proj1>, - projected, Proj2>> + projected, Proj2>>() safe_iterator_t find_first_of(Rng1&& rng1, Rng2&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -64,9 +64,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectPredicate, - projected, Proj2>> + projected, Proj2>>() dangling find_first_of(std::initializer_list&& rng1, Rng2&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -82,9 +82,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectPredicate, Proj1>, - projected> + projected>() safe_iterator_t find_first_of(Rng1&& rng1, std::initializer_list&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -100,9 +100,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectPredicate, - projected> + projected>() dangling find_first_of(std::initializer_list&& rng1, std::initializer_list&& rng2, Pred pred = Pred{}, diff --git a/include/stl2/detail/algorithm/find_if.hpp b/include/stl2/detail/algorithm/find_if.hpp index 290242f7b..cee9823aa 100644 --- a/include/stl2/detail/algorithm/find_if.hpp +++ b/include/stl2/detail/algorithm/find_if.hpp @@ -24,8 +24,8 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class Proj = identity> requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() I find_if(I first, S last, Pred pred, Proj proj = Proj{}) { for (; first != last; ++first) { @@ -38,8 +38,8 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectPredicate< - Pred, projected, Proj>> + IndirectPredicate< + Pred, projected, Proj>>() safe_iterator_t find_if(Rng&& rng, Pred pred, Proj proj = Proj{}) { @@ -50,8 +50,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() dangling find_if(std::initializer_list&& il, Pred pred, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/find_if_not.hpp b/include/stl2/detail/algorithm/find_if_not.hpp index 9d8d5942d..5b72d0200 100644 --- a/include/stl2/detail/algorithm/find_if_not.hpp +++ b/include/stl2/detail/algorithm/find_if_not.hpp @@ -25,10 +25,10 @@ STL2_OPEN_NAMESPACE { template requires - models::InputIterator<__f> && - models::Sentinel<__f, __f> && - models::IndirectPredicate< - Pred, projected<__f, Proj>> + InputIterator<__f>() && + Sentinel<__f, __f>() && + IndirectPredicate< + Pred, projected<__f, Proj>>() __f find_if_not(I&& first, S&& last, Pred pred, Proj proj = Proj{}) { return __stl2::find_if(__stl2::forward(first), __stl2::forward(last), @@ -37,8 +37,8 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectPredicate< - Pred, projected, Proj>> + IndirectPredicate< + Pred, projected, Proj>>() safe_iterator_t find_if_not(Rng&& rng, Pred pred, Proj proj = Proj{}) { @@ -49,8 +49,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() dangling find_if_not(std::initializer_list&& il, Pred pred, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/for_each.hpp b/include/stl2/detail/algorithm/for_each.hpp index ca701dd43..376987ef0 100644 --- a/include/stl2/detail/algorithm/for_each.hpp +++ b/include/stl2/detail/algorithm/for_each.hpp @@ -25,8 +25,8 @@ STL2_OPEN_NAMESPACE { template S, class F, class Proj = identity> requires - models::IndirectInvocable< - F, projected> + IndirectInvocable< + F, projected>() tagged_pair for_each(I first, S last, F fun, Proj proj = Proj{}) { @@ -38,8 +38,8 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectInvocable< - F, projected, Proj>> + IndirectInvocable< + F, projected, Proj>>() tagged_pair), tag::fun(F)> for_each(Rng&& rng, F fun, Proj proj = Proj{}) { @@ -50,8 +50,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::IndirectInvocable< - F, projected> + IndirectInvocable< + F, projected>() tagged_pair), tag::fun(F)> for_each(std::initializer_list&& il, F fun, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/forward_sort.hpp b/include/stl2/detail/algorithm/forward_sort.hpp index 8a062bb80..58b6d965b 100644 --- a/include/stl2/detail/algorithm/forward_sort.hpp +++ b/include/stl2/detail/algorithm/forward_sort.hpp @@ -50,7 +50,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() inline I merge_n_with_buffer(I f0, difference_type_t n0, I f1, difference_type_t n1, buf_t& buf, Comp& comp, Proj& proj) @@ -73,7 +73,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() inline void merge_n_step_0(I f0, difference_type_t n0, I f1, difference_type_t n1, Comp& comp, Proj& proj, @@ -98,7 +98,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() inline void merge_n_step_1(I f0, difference_type_t n0, I f1, difference_type_t n1, Comp& comp, Proj& proj, @@ -123,7 +123,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() I merge_n_adaptive(I f0, difference_type_t n0, I f1, difference_type_t n1, buf_t& buf, Comp& comp, Proj& proj) @@ -154,7 +154,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() I sort_n_adaptive(I first, const difference_type_t n, buf_t& buf, Comp& comp, Proj& proj) { @@ -171,7 +171,7 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sortable + Sortable() inline I sort_n(I first, const difference_type_t n, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/generate.hpp b/include/stl2/detail/algorithm/generate.hpp index 3fb0d03fe..72471f37b 100644 --- a/include/stl2/detail/algorithm/generate.hpp +++ b/include/stl2/detail/algorithm/generate.hpp @@ -22,8 +22,8 @@ STL2_OPEN_NAMESPACE { template S> requires - models::Invocable && - models::Writable> + Invocable() && + Writable>() O generate(O first, S last, F gen) { for (; first != last; ++first) { @@ -34,8 +34,8 @@ STL2_OPEN_NAMESPACE { template requires - models::Invocable && - models::OutputRange> + Invocable() && + OutputRange>() safe_iterator_t generate(Rng&& rng, F gen) { diff --git a/include/stl2/detail/algorithm/generate_n.hpp b/include/stl2/detail/algorithm/generate_n.hpp index 1a7489c77..577b1f619 100644 --- a/include/stl2/detail/algorithm/generate_n.hpp +++ b/include/stl2/detail/algorithm/generate_n.hpp @@ -22,8 +22,8 @@ STL2_OPEN_NAMESPACE { template requires - models::Invocable && - models::Writable> + Invocable() && + Writable>() O generate_n(O first, difference_type_t n, F gen) { for (; n > 0; ++first, --n) { diff --git a/include/stl2/detail/algorithm/heap_sift.hpp b/include/stl2/detail/algorithm/heap_sift.hpp index 01d57e018..76178e308 100644 --- a/include/stl2/detail/algorithm/heap_sift.hpp +++ b/include/stl2/detail/algorithm/heap_sift.hpp @@ -35,8 +35,8 @@ STL2_OPEN_NAMESPACE { namespace detail { template requires - models::IndirectStrictWeakOrder, projected> + IndirectStrictWeakOrder, projected>() void sift_up_n(I first, difference_type_t n, Comp comp, Proj proj) { if (n > 1) { @@ -61,8 +61,8 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectStrictWeakOrder, projected> + IndirectStrictWeakOrder, projected>() void sift_down_n(I first, difference_type_t n, I start, Comp comp, Proj proj) { diff --git a/include/stl2/detail/algorithm/includes.hpp b/include/stl2/detail/algorithm/includes.hpp index 263bbafbc..d7cfa7ce6 100644 --- a/include/stl2/detail/algorithm/includes.hpp +++ b/include/stl2/detail/algorithm/includes.hpp @@ -25,8 +25,8 @@ STL2_OPEN_NAMESPACE { InputIterator I2, Sentinel S2, class Comp = less<>, class Proj1 = identity, class Proj2 = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected, projected> + IndirectStrictWeakOrder< + Comp, projected, projected>() bool includes(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -50,9 +50,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectStrictWeakOrder, Proj1>, - projected, Proj2>> + projected, Proj2>>() bool includes(Rng1&& rng1, Rng2&& rng2, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -68,9 +68,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectStrictWeakOrder, - projected, Proj2>> + projected, Proj2>>() bool includes(std::initializer_list&& rng1, Rng2&& rng2, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -86,9 +86,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectStrictWeakOrder, Proj1>, - projected> + projected>() bool includes(Rng1&& rng1, std::initializer_list&& rng2, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -104,9 +104,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectStrictWeakOrder, - projected> + projected>() bool includes(std::initializer_list&& rng1, std::initializer_list&& rng2, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) diff --git a/include/stl2/detail/algorithm/inplace_merge.hpp b/include/stl2/detail/algorithm/inplace_merge.hpp index 7c82203cf..4428a7939 100644 --- a/include/stl2/detail/algorithm/inplace_merge.hpp +++ b/include/stl2/detail/algorithm/inplace_merge.hpp @@ -48,7 +48,7 @@ STL2_OPEN_NAMESPACE { private: template requires - models::Sortable + Sortable() static void impl(I begin, I middle, I end, difference_type_t len1, difference_type_t len2, temporary_buffer>& buf, C& pred, P& proj) @@ -82,7 +82,7 @@ STL2_OPEN_NAMESPACE { public: template requires - models::Sortable, __f

> + Sortable, __f

>() void operator()(I begin, I middle, I end, difference_type_t len1, difference_type_t len2, detail::temporary_buffer>& buf, C pred, P proj) const { @@ -177,7 +177,7 @@ STL2_OPEN_NAMESPACE { { template , class P = identity> requires - models::Sortable, __f

> + Sortable, __f

>() void operator()(I begin, I middle, I end, difference_type_t len1, difference_type_t len2, C pred = C{}, P proj = P{}) const { @@ -195,7 +195,7 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::Sortable + Sortable() I inplace_merge(I first, I middle, S last, Comp comp = Comp{}, Proj proj = Proj{}) { auto len1 = __stl2::distance(first, middle); @@ -212,7 +212,7 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sortable, Comp, Proj> + Sortable, Comp, Proj>() safe_iterator_t inplace_merge(Rng&& rng, iterator_t middle, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/is_heap.hpp b/include/stl2/detail/algorithm/is_heap.hpp index 7526c7210..b4d1974d7 100644 --- a/include/stl2/detail/algorithm/is_heap.hpp +++ b/include/stl2/detail/algorithm/is_heap.hpp @@ -35,8 +35,8 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() bool is_heap(I first, S last, Comp comp = Comp{}, Proj proj = Proj{}) { return last == __stl2::is_heap_until(__stl2::move(first), last, @@ -45,8 +45,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected, Proj>> + IndirectStrictWeakOrder< + Comp, projected, Proj>>() bool is_heap(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { return __stl2::end(rng) == @@ -57,8 +57,8 @@ STL2_OPEN_NAMESPACE { // Extension template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() bool is_heap(std::initializer_list&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { return __stl2::end(rng) == diff --git a/include/stl2/detail/algorithm/is_heap_until.hpp b/include/stl2/detail/algorithm/is_heap_until.hpp index 159fdfba9..a3209d722 100644 --- a/include/stl2/detail/algorithm/is_heap_until.hpp +++ b/include/stl2/detail/algorithm/is_heap_until.hpp @@ -34,8 +34,8 @@ STL2_OPEN_NAMESPACE { namespace detail { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() I is_heap_until_n(I first, const difference_type_t n, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -63,8 +63,8 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() I is_heap_until(I first, S last, Comp comp = Comp{}, Proj proj = Proj{}) { auto n = __stl2::distance(first, __stl2::move(last)); @@ -74,8 +74,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected, Proj>> + IndirectStrictWeakOrder< + Comp, projected, Proj>>() safe_iterator_t is_heap_until(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/is_partitioned.hpp b/include/stl2/detail/algorithm/is_partitioned.hpp index b98def309..c757da7db 100644 --- a/include/stl2/detail/algorithm/is_partitioned.hpp +++ b/include/stl2/detail/algorithm/is_partitioned.hpp @@ -25,8 +25,8 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class Proj = identity> requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() bool is_partitioned(I first, S last, Pred pred, Proj proj = Proj{}) { first = __stl2::find_if_not(__stl2::move(first), last, @@ -37,8 +37,8 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectPredicate< - Pred, projected, Proj>> + IndirectPredicate< + Pred, projected, Proj>>() bool is_partitioned(Rng&& rng, Pred pred, Proj proj = Proj{}) { return __stl2::is_partitioned(__stl2::begin(rng), __stl2::end(rng), @@ -48,8 +48,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() bool is_partitioned(std::initializer_list&& rng, Pred pred, Proj proj = Proj{}) { return __stl2::is_partitioned(__stl2::begin(rng), __stl2::end(rng), diff --git a/include/stl2/detail/algorithm/is_permutation.hpp b/include/stl2/detail/algorithm/is_permutation.hpp index 32fba99f7..966555f50 100644 --- a/include/stl2/detail/algorithm/is_permutation.hpp +++ b/include/stl2/detail/algorithm/is_permutation.hpp @@ -26,7 +26,7 @@ STL2_OPEN_NAMESPACE { ForwardIterator I2, Sentinel S2, class Pred, class Proj1, class Proj2> requires - models::IndirectlyComparable, __f, __f> + IndirectlyComparable, __f, __f>() bool __is_permutation_tail(I1 first1, S1 last1, I2 first2, S2 last2, Pred& pred, Proj1& proj1, Proj2& proj2) { @@ -72,7 +72,7 @@ STL2_OPEN_NAMESPACE { [[deprecated]] bool is_permutation(I1 first1, S1 last1, I2 first2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) requires - models::IndirectlyComparable + IndirectlyComparable() { // shorten sequences as much as possible by lopping off any equal parts for (; first1 != last1; ++first1, ++first2) { @@ -100,9 +100,9 @@ STL2_OPEN_NAMESPACE { Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) requires !is_array>::value && - models::ForwardIterator<__f> && - models::IndirectlyComparable< - iterator_t, __f, Pred, Proj1, Proj2> + ForwardIterator<__f>() && + IndirectlyComparable< + iterator_t, __f, Pred, Proj1, Proj2>() { auto first2 = __stl2::forward(first2_); return __stl2::is_permutation( @@ -115,8 +115,8 @@ STL2_OPEN_NAMESPACE { Sentinel S2, class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> requires - models::IndirectlyComparable< - I1, I2, Pred, Proj1, Proj2> + IndirectlyComparable< + I1, I2, Pred, Proj1, Proj2>() bool is_permutation(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -144,9 +144,9 @@ STL2_OPEN_NAMESPACE { Sentinel S2, class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> requires - models::SizedSentinel && - models::SizedSentinel && - models::IndirectlyComparable + SizedSentinel() && + SizedSentinel() && + IndirectlyComparable() bool is_permutation(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -170,9 +170,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectlyComparable< + IndirectlyComparable< iterator_t, iterator_t, - Pred, Proj1, Proj2> + Pred, Proj1, Proj2>() bool is_permutation(Rng1&& rng1, Rng2&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -186,11 +186,11 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::SizedRange && - models::SizedRange && - models::IndirectlyComparable< + SizedRange() && + SizedRange() && + IndirectlyComparable< iterator_t, iterator_t, - Pred, Proj1, Proj2> + Pred, Proj1, Proj2>() bool is_permutation(Rng1&& rng1, Rng2&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { diff --git a/include/stl2/detail/algorithm/is_sorted.hpp b/include/stl2/detail/algorithm/is_sorted.hpp index 5e9db7d2c..0c0e4cb53 100644 --- a/include/stl2/detail/algorithm/is_sorted.hpp +++ b/include/stl2/detail/algorithm/is_sorted.hpp @@ -25,8 +25,8 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() bool is_sorted(I first, S last, Comp comp = Comp{}, Proj proj = Proj{}) { return last == __stl2::is_sorted_until(__stl2::move(first), last, @@ -35,8 +35,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected, Proj>> + IndirectStrictWeakOrder< + Comp, projected, Proj>>() bool is_sorted(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { return __stl2::end(rng) == @@ -47,8 +47,8 @@ STL2_OPEN_NAMESPACE { // Extension template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() bool is_sorted(std::initializer_list&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { return __stl2::end(rng) == diff --git a/include/stl2/detail/algorithm/is_sorted_until.hpp b/include/stl2/detail/algorithm/is_sorted_until.hpp index 826d2a63b..1a3978b55 100644 --- a/include/stl2/detail/algorithm/is_sorted_until.hpp +++ b/include/stl2/detail/algorithm/is_sorted_until.hpp @@ -24,8 +24,8 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() I is_sorted_until(I first, S last, Comp comp = Comp{}, Proj proj = Proj{}) { if (first != last) { @@ -42,8 +42,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected, Proj>> + IndirectStrictWeakOrder< + Comp, projected, Proj>>() safe_iterator_t is_sorted_until(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -54,8 +54,8 @@ STL2_OPEN_NAMESPACE { // Extension template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() dangling is_sorted_until(std::initializer_list&& rng, Comp comp = Comp{}, Proj proj = Proj{}) diff --git a/include/stl2/detail/algorithm/lexicographical_compare.hpp b/include/stl2/detail/algorithm/lexicographical_compare.hpp index 5bd6e7974..2f6b78579 100644 --- a/include/stl2/detail/algorithm/lexicographical_compare.hpp +++ b/include/stl2/detail/algorithm/lexicographical_compare.hpp @@ -24,8 +24,8 @@ STL2_OPEN_NAMESPACE { template S1, InputIterator I2, Sentinel S2, class Comp = less<>, class Proj1 = identity, class Proj2 = identity> requires - models::IndirectStrictWeakOrder, projected> + IndirectStrictWeakOrder, projected>() bool lexicographical_compare(I1 first1, S1 last1, I2 first2, S2 last2, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -43,9 +43,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectStrictWeakOrder, Proj1>, - projected, Proj2>> + projected, Proj2>>() bool lexicographical_compare(Rng1&& rng1, Rng2&& rng2, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -61,9 +61,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectStrictWeakOrder, - projected, Proj2>> + projected, Proj2>>() bool lexicographical_compare(std::initializer_list&& rng1, Rng2&& rng2, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -79,9 +79,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectStrictWeakOrder, Proj1>, - projected> + projected>() bool lexicographical_compare(Rng1&& rng1, std::initializer_list&& rng2, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -97,9 +97,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectStrictWeakOrder, - projected> + projected>() bool lexicographical_compare( std::initializer_list&& rng1, std::initializer_list&& rng2, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) diff --git a/include/stl2/detail/algorithm/lower_bound.hpp b/include/stl2/detail/algorithm/lower_bound.hpp index ac9c1143e..87744b85c 100644 --- a/include/stl2/detail/algorithm/lower_bound.hpp +++ b/include/stl2/detail/algorithm/lower_bound.hpp @@ -38,9 +38,9 @@ STL2_OPEN_NAMESPACE { namespace ext { template , class Proj = identity> requires - models::ForwardIterator<__f> && - models::IndirectStrictWeakOrder< - Comp, const T*, projected<__f, Proj>> + ForwardIterator<__f>() && + IndirectStrictWeakOrder< + Comp, const T*, projected<__f, Proj>>() __f lower_bound_n(I&& first, difference_type_t<__f> n, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -53,10 +53,10 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::ForwardIterator<__f> && - models::Sentinel<__f, __f> && - models::IndirectStrictWeakOrder< - Comp, const T*, projected<__f, Proj>> + ForwardIterator<__f>() && + Sentinel<__f, __f>() && + IndirectStrictWeakOrder< + Comp, const T*, projected<__f, Proj>>() __f lower_bound(I&& first, S&& last, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -68,11 +68,11 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::SizedSentinel<__f, __f> && - models::ForwardIterator<__f> && - models::Sentinel<__f, __f> && - models::IndirectStrictWeakOrder< - Comp, const T*, projected<__f, Proj>> + SizedSentinel<__f, __f>() && + ForwardIterator<__f>() && + Sentinel<__f, __f>() && + IndirectStrictWeakOrder< + Comp, const T*, projected<__f, Proj>>() __f lower_bound(I&& first_, S&& last, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -84,8 +84,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, const T*, projected, Proj>> + IndirectStrictWeakOrder< + Comp, const T*, projected, Proj>>() safe_iterator_t lower_bound(Rng&& rng, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -95,9 +95,9 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::SizedRange && - models::IndirectStrictWeakOrder< - Comp, const T*, projected, Proj>> + SizedRange() && + IndirectStrictWeakOrder< + Comp, const T*, projected, Proj>>() safe_iterator_t lower_bound(Rng&& rng, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -109,8 +109,8 @@ STL2_OPEN_NAMESPACE { // Extension template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, const T*, projected> + IndirectStrictWeakOrder< + Comp, const T*, projected>() dangling lower_bound(std::initializer_list&& rng, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) diff --git a/include/stl2/detail/algorithm/make_heap.hpp b/include/stl2/detail/algorithm/make_heap.hpp index 4b48324ff..b567eb351 100644 --- a/include/stl2/detail/algorithm/make_heap.hpp +++ b/include/stl2/detail/algorithm/make_heap.hpp @@ -35,7 +35,7 @@ STL2_OPEN_NAMESPACE { namespace detail { template requires - models::Sortable + Sortable() void make_heap_n(I first, difference_type_t n, Comp comp, Proj proj) { if (n > 1) { @@ -51,7 +51,7 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::Sortable + Sortable() I make_heap(I first, S last, Comp comp = Comp{}, Proj proj = Proj{}) { auto n = __stl2::distance(first, __stl2::move(last)); @@ -62,7 +62,7 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sortable, Comp, Proj> + Sortable, Comp, Proj>() safe_iterator_t make_heap(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/max.hpp b/include/stl2/detail/algorithm/max.hpp index fbf2d27ca..ef86852e8 100644 --- a/include/stl2/detail/algorithm/max.hpp +++ b/include/stl2/detail/algorithm/max.hpp @@ -27,9 +27,9 @@ STL2_OPEN_NAMESPACE { namespace __max { template requires - models::Copyable>> && - models::IndirectStrictWeakOrder< - Comp, projected, Proj>> + Copyable>>() && + IndirectStrictWeakOrder< + Comp, projected, Proj>>() constexpr value_type_t> impl(Rng&& rng, Comp comp, Proj proj) { @@ -49,8 +49,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() constexpr const T& max(const T& a, const T& b, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -59,9 +59,9 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Copyable>> && - models::IndirectStrictWeakOrder< - Comp, projected, Proj>> + Copyable>>() && + IndirectStrictWeakOrder< + Comp, projected, Proj>>() STL2_CONSTEXPR_EXT value_type_t> max(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -71,8 +71,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() constexpr T max(std::initializer_list&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { return __max::impl(rng, __stl2::ref(comp), __stl2::ref(proj)); diff --git a/include/stl2/detail/algorithm/max_element.hpp b/include/stl2/detail/algorithm/max_element.hpp index 4f115c6f2..792d5815c 100644 --- a/include/stl2/detail/algorithm/max_element.hpp +++ b/include/stl2/detail/algorithm/max_element.hpp @@ -24,8 +24,8 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() I max_element(I first, S last, Comp comp = Comp{}, Proj proj = Proj{}) { if (first != last) { @@ -40,8 +40,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected, Proj>> + IndirectStrictWeakOrder< + Comp, projected, Proj>>() safe_iterator_t max_element(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -52,8 +52,8 @@ STL2_OPEN_NAMESPACE { // Extension template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() dangling max_element(std::initializer_list&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/merge.hpp b/include/stl2/detail/algorithm/merge.hpp index 0c03f9782..d6feb43ff 100644 --- a/include/stl2/detail/algorithm/merge.hpp +++ b/include/stl2/detail/algorithm/merge.hpp @@ -28,7 +28,7 @@ STL2_OPEN_NAMESPACE { class O, class Comp = less<>, class Proj1 = identity, class Proj2 = identity> requires - models::Mergeable + Mergeable() tagged_tuple merge(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, @@ -63,9 +63,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::Mergeable< + Mergeable< iterator_t, iterator_t, __f, - Comp, Proj1, Proj2> + Comp, Proj1, Proj2>() tagged_tuple), tag::in2(safe_iterator_t), tag::out(__f)> merge(Rng1&& rng1, Rng2&& rng2, O&& result, Comp comp = Comp{}, @@ -82,9 +82,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::Mergeable< + Mergeable< const E*, iterator_t, __f, - Comp, Proj1, Proj2> + Comp, Proj1, Proj2>() tagged_tuple), tag::in2(safe_iterator_t), tag::out(__f)> merge(std::initializer_list&& rng1, Rng2&& rng2, O&& result, @@ -101,9 +101,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::Mergeable< + Mergeable< iterator_t, const E*, __f, - Comp, Proj1, Proj2> + Comp, Proj1, Proj2>() tagged_tuple), tag::in2(dangling), tag::out(__f)> merge(Rng1&& rng1, std::initializer_list&& rng2, O&& result, @@ -120,9 +120,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::Mergeable< + Mergeable< const E1*, const E2*, __f, - Comp, Proj1, Proj2> + Comp, Proj1, Proj2>() tagged_tuple), tag::in2(dangling), tag::out(__f)> merge(std::initializer_list&& rng1, std::initializer_list&& rng2, diff --git a/include/stl2/detail/algorithm/min.hpp b/include/stl2/detail/algorithm/min.hpp index d95a069df..9f3908087 100644 --- a/include/stl2/detail/algorithm/min.hpp +++ b/include/stl2/detail/algorithm/min.hpp @@ -26,9 +26,9 @@ STL2_OPEN_NAMESPACE { namespace __min { template , class Proj = identity> requires - models::Copyable>> && - models::IndirectStrictWeakOrder< - Comp, projected, Proj>> + Copyable>>() && + IndirectStrictWeakOrder< + Comp, projected, Proj>>() constexpr value_type_t> impl(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -48,8 +48,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() constexpr const T& min(const T& a, const T& b, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -58,9 +58,9 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Copyable>> && - models::IndirectStrictWeakOrder< - Comp, projected, Proj>> + Copyable>>() && + IndirectStrictWeakOrder< + Comp, projected, Proj>>() STL2_CONSTEXPR_EXT value_type_t> min(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -70,8 +70,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() constexpr T min(std::initializer_list&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/min_element.hpp b/include/stl2/detail/algorithm/min_element.hpp index ca79169a8..e2dd275e2 100644 --- a/include/stl2/detail/algorithm/min_element.hpp +++ b/include/stl2/detail/algorithm/min_element.hpp @@ -25,8 +25,8 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() I min_element(I first, S last, Comp comp = Comp{}, Proj proj = Proj{}) { if (first != last) { @@ -41,8 +41,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected, Proj>> + IndirectStrictWeakOrder< + Comp, projected, Proj>>() safe_iterator_t min_element(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -53,8 +53,8 @@ STL2_OPEN_NAMESPACE { // Extension template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() dangling min_element(std::initializer_list&& rng, Comp comp = Comp{}, Proj proj = Proj{}) diff --git a/include/stl2/detail/algorithm/minmax.hpp b/include/stl2/detail/algorithm/minmax.hpp index 183829dab..1fb623cce 100644 --- a/include/stl2/detail/algorithm/minmax.hpp +++ b/include/stl2/detail/algorithm/minmax.hpp @@ -27,9 +27,9 @@ STL2_OPEN_NAMESPACE { namespace __minmax { template , class Proj = identity> requires - models::Copyable>> && - models::IndirectStrictWeakOrder< - Comp, projected, Proj>> + Copyable>>() && + IndirectStrictWeakOrder< + Comp, projected, Proj>>() constexpr tagged_pair>), tag::max(value_type_t>)> impl(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) @@ -85,8 +85,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() constexpr tagged_pair minmax(const T& a, const T& b, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -99,9 +99,9 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Copyable>> && - models::IndirectStrictWeakOrder< - Comp, projected, Proj>> + Copyable>>() && + IndirectStrictWeakOrder< + Comp, projected, Proj>>() STL2_CONSTEXPR_EXT tagged_pair>), tag::max(value_type_t>)> minmax(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) @@ -111,8 +111,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() constexpr tagged_pair minmax(std::initializer_list&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/minmax_element.hpp b/include/stl2/detail/algorithm/minmax_element.hpp index 7e3079cd1..391772fd8 100644 --- a/include/stl2/detail/algorithm/minmax_element.hpp +++ b/include/stl2/detail/algorithm/minmax_element.hpp @@ -30,8 +30,8 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() STL2_CONSTEXPR_EXT tagged_pair minmax_element(I first, S last, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -76,8 +76,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected, Proj>> + IndirectStrictWeakOrder< + Comp, projected, Proj>>() STL2_CONSTEXPR_EXT tagged_pair), tag::max(safe_iterator_t)> minmax_element(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) @@ -89,8 +89,8 @@ STL2_OPEN_NAMESPACE { // Extension template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, projected> + IndirectStrictWeakOrder< + Comp, projected>() STL2_CONSTEXPR_EXT tagged_pair), tag::max(dangling)> minmax_element(std::initializer_list&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/mismatch.hpp b/include/stl2/detail/algorithm/mismatch.hpp index 3d6f21577..eae379f26 100644 --- a/include/stl2/detail/algorithm/mismatch.hpp +++ b/include/stl2/detail/algorithm/mismatch.hpp @@ -29,9 +29,9 @@ STL2_OPEN_NAMESPACE { mismatch(I1 first1, S1 last1, I2 first2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) requires - models::IndirectPredicate, - projected> + projected>() { for (; first1 != last1; ++first1, ++first2) { if (!__stl2::invoke(pred, __stl2::invoke(proj1, *first1), __stl2::invoke(proj2, *first2))) { @@ -45,8 +45,8 @@ STL2_OPEN_NAMESPACE { InputIterator I2, Sentinel S2, class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> requires - models::IndirectPredicate< - Pred, projected, projected> + IndirectPredicate< + Pred, projected, projected>() tagged_pair mismatch(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -67,10 +67,10 @@ STL2_OPEN_NAMESPACE { Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) requires !is_array>::value && - models::InputIterator<__f> && - models::IndirectPredicate>() && + IndirectPredicate, Proj1>, - projected<__f, Proj2>> + projected<__f, Proj2>>() { auto first2 = std::forward(first2_); return __stl2::mismatch( @@ -82,9 +82,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectPredicate, Proj1>, - projected, Proj2>> + projected, Proj2>>() tagged_pair), tag::in2(safe_iterator_t)> mismatch(Rng1&& rng1, Rng2&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) diff --git a/include/stl2/detail/algorithm/move.hpp b/include/stl2/detail/algorithm/move.hpp index bcd1cbe8a..5d51558fb 100644 --- a/include/stl2/detail/algorithm/move.hpp +++ b/include/stl2/detail/algorithm/move.hpp @@ -23,7 +23,7 @@ STL2_OPEN_NAMESPACE { template S, WeaklyIncrementable O> requires - models::IndirectlyMovable + IndirectlyMovable() tagged_pair move(I first, S last, O result) { #if 1 @@ -40,8 +40,8 @@ STL2_OPEN_NAMESPACE { template requires - models::WeaklyIncrementable<__f> && - models::IndirectlyMovable, __f> + WeaklyIncrementable<__f>() && + IndirectlyMovable, __f>() tagged_pair), tag::out(__f)> move(Rng&& rng, O&& result) { return __stl2::move(__stl2::begin(rng), __stl2::end(rng), __stl2::forward(result)); @@ -50,8 +50,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::WeaklyIncrementable<__f> && - models::IndirectlyMovable> + WeaklyIncrementable<__f>() && + IndirectlyMovable>() tagged_pair), tag::out(__f)> move(std::initializer_list&& rng, O&& result) { return __stl2::move(__stl2::begin(rng), __stl2::end(rng), __stl2::forward(result)); @@ -61,7 +61,7 @@ STL2_OPEN_NAMESPACE { // Extension template S1, Iterator I2, Sentinel S2> requires - models::IndirectlyMovable + IndirectlyMovable() tagged_pair move(I1 first1, S1 last1, I2 first2, S2 last2) { #if 1 @@ -82,7 +82,7 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::IndirectlyMovable, iterator_t> + IndirectlyMovable, iterator_t>() tagged_pair< tag::in(safe_iterator_t), tag::out(safe_iterator_t)> @@ -94,7 +94,7 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::IndirectlyMovable> + IndirectlyMovable>() tagged_pair< tag::in(dangling), tag::out(safe_iterator_t)> diff --git a/include/stl2/detail/algorithm/move_backward.hpp b/include/stl2/detail/algorithm/move_backward.hpp index 3e642b117..2c0c58daa 100644 --- a/include/stl2/detail/algorithm/move_backward.hpp +++ b/include/stl2/detail/algorithm/move_backward.hpp @@ -23,7 +23,7 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectlyMovable + IndirectlyMovable() tagged_pair move_backward(I1 first, I1 last, I2 result) { @@ -44,8 +44,8 @@ STL2_OPEN_NAMESPACE { template S1, class I2> requires - models::BidirectionalIterator<__f> && - models::IndirectlyMovable> + BidirectionalIterator<__f>() && + IndirectlyMovable>() tagged_pair)> move_backward(I1 first, S1 s, I2&& out) { @@ -56,8 +56,8 @@ STL2_OPEN_NAMESPACE { template requires - models::BidirectionalIterator<__f> && - models::IndirectlyMovable, __f> + BidirectionalIterator<__f>() && + IndirectlyMovable, __f>() tagged_pair), tag::out(__f)> move_backward(Rng&& rng, I&& result) { @@ -68,8 +68,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::BidirectionalIterator<__f> && - models::IndirectlyMovable> + BidirectionalIterator<__f>() && + IndirectlyMovable>() tagged_pair), tag::out(__f)> move_backward(std::initializer_list&& rng, I&& result) { diff --git a/include/stl2/detail/algorithm/next_permutation.hpp b/include/stl2/detail/algorithm/next_permutation.hpp index 483947848..5ae218920 100644 --- a/include/stl2/detail/algorithm/next_permutation.hpp +++ b/include/stl2/detail/algorithm/next_permutation.hpp @@ -35,7 +35,7 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::Sortable + Sortable() bool next_permutation(I first, S last, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -66,7 +66,7 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sortable, Comp, Proj> + Sortable, Comp, Proj>() bool next_permutation(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { return __stl2::next_permutation(__stl2::begin(rng), __stl2::end(rng), diff --git a/include/stl2/detail/algorithm/none_of.hpp b/include/stl2/detail/algorithm/none_of.hpp index df0418fe4..8a42ed5f9 100644 --- a/include/stl2/detail/algorithm/none_of.hpp +++ b/include/stl2/detail/algorithm/none_of.hpp @@ -24,8 +24,8 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class Proj = identity> requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() bool none_of(I first, S last, Pred pred, Proj proj = Proj{}) { for (; first != last; ++first) { @@ -38,8 +38,8 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectPredicate< - Pred, projected, Proj>> + IndirectPredicate< + Pred, projected, Proj>>() bool none_of(Rng&& rng, Pred pred, Proj proj = Proj{}) { return __stl2::none_of(__stl2::begin(rng), __stl2::end(rng), @@ -49,8 +49,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() bool none_of(std::initializer_list&& rng, Pred pred, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/nth_element.hpp b/include/stl2/detail/algorithm/nth_element.hpp index 2dcb9548c..b7b4467da 100644 --- a/include/stl2/detail/algorithm/nth_element.hpp +++ b/include/stl2/detail/algorithm/nth_element.hpp @@ -36,7 +36,7 @@ STL2_OPEN_NAMESPACE { // stable, 2-3 compares, 0-2 swaps template requires - models::Sortable + Sortable() unsigned sort3(I x, I y, I z, C& comp, P& proj) { if (!__stl2::invoke(comp, __stl2::invoke(proj, *y), __stl2::invoke(proj, *x))) { // if x <= y @@ -66,7 +66,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() void selection_sort(I begin, I end, C &comp, P &proj) { STL2_EXPECT(begin != end); @@ -82,7 +82,7 @@ STL2_OPEN_NAMESPACE { // TODO: refactor this monstrosity. template S, class Comp = less<>, class Proj = identity> requires - models::Sortable + Sortable() I nth_element(I first, I nth, S last, Comp comp = Comp{}, Proj proj = Proj{}) { I end = __stl2::next(nth, last), end_orig = end; @@ -260,7 +260,7 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sortable, Comp, Proj> + Sortable, Comp, Proj>() safe_iterator_t nth_element(Rng&& rng, iterator_t nth, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/partial_sort.hpp b/include/stl2/detail/algorithm/partial_sort.hpp index d114f4d5d..90291d70e 100644 --- a/include/stl2/detail/algorithm/partial_sort.hpp +++ b/include/stl2/detail/algorithm/partial_sort.hpp @@ -28,7 +28,7 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::Sortable + Sortable() I partial_sort(I first, I middle, S last, Comp comp = Comp{}, Proj proj = Proj{}) { __stl2::make_heap(first, middle, __stl2::ref(comp), __stl2::ref(proj)); @@ -46,7 +46,7 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sortable, Comp, Proj> + Sortable, Comp, Proj>() safe_iterator_t partial_sort(Rng&& rng, iterator_t middle, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/partial_sort_copy.hpp b/include/stl2/detail/algorithm/partial_sort_copy.hpp index 197d24b8a..df1c3ff37 100644 --- a/include/stl2/detail/algorithm/partial_sort_copy.hpp +++ b/include/stl2/detail/algorithm/partial_sort_copy.hpp @@ -33,10 +33,10 @@ STL2_OPEN_NAMESPACE { class Comp = less<>, class Proj1 = identity, class Proj2 = identity> requires - models::IndirectlyCopyable && - models::Sortable && - models::IndirectStrictWeakOrder< - Comp, projected, projected> + IndirectlyCopyable() && + Sortable() && + IndirectStrictWeakOrder< + Comp, projected, projected>() I2 partial_sort_copy(I1 first, S1 last, I2 result_first, S2 result_last, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -63,11 +63,11 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectlyCopyable, iterator_t> && - models::Sortable, Comp, Proj2> && - models::IndirectStrictWeakOrder, iterator_t>() && + Sortable, Comp, Proj2>() && + IndirectStrictWeakOrder, Proj1>, - projected, Proj2>> + projected, Proj2>>() safe_iterator_t partial_sort_copy(Rng1&& rng, Rng2&& result_rng, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -83,11 +83,11 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectlyCopyable> && - models::Sortable, Comp, Proj2> && - models::IndirectStrictWeakOrder>() && + Sortable, Comp, Proj2>() && + IndirectStrictWeakOrder, - projected, Proj2>> + projected, Proj2>>() safe_iterator_t partial_sort_copy(std::initializer_list&& rng, Rng2&& result_rng, Comp comp = Comp{}, diff --git a/include/stl2/detail/algorithm/partition.hpp b/include/stl2/detail/algorithm/partition.hpp index c8904bf0c..ba0772bdc 100644 --- a/include/stl2/detail/algorithm/partition.hpp +++ b/include/stl2/detail/algorithm/partition.hpp @@ -35,8 +35,8 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class Proj = identity> requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() I partition(I first, S last, Pred pred, Proj proj = Proj{}) { first = __stl2::find_if_not(__stl2::move(first), last, @@ -54,9 +54,9 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class Proj = identity> requires - models::BidirectionalIterator && - models::IndirectPredicate< - Pred, projected> + BidirectionalIterator() && + IndirectPredicate< + Pred, projected>() I partition(I first, S last_, Pred pred, Proj proj = Proj{}) { auto last = __stl2::next(first, __stl2::move(last_)); @@ -79,9 +79,9 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable> && - models::IndirectPredicate< - Pred, projected, Proj>> + Permutable>() && + IndirectPredicate< + Pred, projected, Proj>>() safe_iterator_t partition(Rng&& rng, Pred pred, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/partition_copy.hpp b/include/stl2/detail/algorithm/partition_copy.hpp index 97b5b302e..a64cea174 100644 --- a/include/stl2/detail/algorithm/partition_copy.hpp +++ b/include/stl2/detail/algorithm/partition_copy.hpp @@ -26,10 +26,10 @@ STL2_OPEN_NAMESPACE { template S, WeaklyIncrementable O1, WeaklyIncrementable O2, class Pred, class Proj = identity> requires - models::IndirectlyCopyable && - models::IndirectlyCopyable && - models::IndirectPredicate< - Pred, projected> + IndirectlyCopyable() && + IndirectlyCopyable() && + IndirectPredicate< + Pred, projected>() tagged_tuple partition_copy(I first, S last, O1 out_true, O2 out_false, Pred pred, Proj proj = Proj{}) @@ -50,12 +50,12 @@ STL2_OPEN_NAMESPACE { template requires - models::WeaklyIncrementable<__f> && - models::WeaklyIncrementable<__f> && - models::IndirectlyCopyable, __f> && - models::IndirectlyCopyable, __f> && - models::IndirectPredicate< - Pred, projected, Proj>> + WeaklyIncrementable<__f>() && + WeaklyIncrementable<__f>() && + IndirectlyCopyable, __f>() && + IndirectlyCopyable, __f>() && + IndirectPredicate< + Pred, projected, Proj>>() tagged_tuple< tag::in(safe_iterator_t), tag::out1(__f), @@ -72,12 +72,12 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::WeaklyIncrementable<__f> && - models::WeaklyIncrementable<__f> && - models::IndirectlyCopyable> && - models::IndirectlyCopyable> && - models::IndirectPredicate< - Pred, projected> + WeaklyIncrementable<__f>() && + WeaklyIncrementable<__f>() && + IndirectlyCopyable>() && + IndirectlyCopyable> ()&& + IndirectPredicate< + Pred, projected>() tagged_tuple< tag::in(dangling), tag::out1(__f), diff --git a/include/stl2/detail/algorithm/partition_point.hpp b/include/stl2/detail/algorithm/partition_point.hpp index 8df7c05be..08b36f9fe 100644 --- a/include/stl2/detail/algorithm/partition_point.hpp +++ b/include/stl2/detail/algorithm/partition_point.hpp @@ -35,8 +35,8 @@ STL2_OPEN_NAMESPACE { namespace ext { template requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() I partition_point_n(I first, difference_type_t n, Pred pred, Proj proj = Proj{}) { @@ -58,8 +58,8 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class Proj = identity> requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() I partition_point(I first, S last, Pred pred, Proj proj = Proj{}) { // Probe exponentially for either end-of-range or an iterator @@ -80,9 +80,9 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class Proj = identity> requires - models::SizedSentinel && - models::IndirectPredicate< - Pred, projected> + SizedSentinel() && + IndirectPredicate< + Pred, projected>() I partition_point(I first, S last, Pred pred, Proj proj = Proj{}) { auto n = __stl2::distance(first, __stl2::move(last)); @@ -92,8 +92,8 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectPredicate< - Pred, projected, Proj>> + IndirectPredicate< + Pred, projected, Proj>>() safe_iterator_t partition_point(Rng&& rng, Pred pred, Proj proj = Proj{}) { @@ -103,9 +103,9 @@ STL2_OPEN_NAMESPACE { template requires - models::SizedRange && - models::IndirectPredicate< - Pred, projected, Proj>> + SizedRange() && + IndirectPredicate< + Pred, projected, Proj>>() safe_iterator_t partition_point(Rng&& rng, Pred pred, Proj proj = Proj{}) { @@ -116,8 +116,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::IndirectPredicate< - Pred, projected> + IndirectPredicate< + Pred, projected>() dangling partition_point(std::initializer_list&& rng, Pred pred, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/pop_heap.hpp b/include/stl2/detail/algorithm/pop_heap.hpp index d1323bf10..4a368efe5 100644 --- a/include/stl2/detail/algorithm/pop_heap.hpp +++ b/include/stl2/detail/algorithm/pop_heap.hpp @@ -35,7 +35,7 @@ STL2_OPEN_NAMESPACE { namespace detail { template requires - models::Sortable + Sortable() void pop_heap_n(I first, difference_type_t n, Comp comp, Proj proj) { if (n > 1) { @@ -49,7 +49,7 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::Sortable + Sortable() I pop_heap(I first, S last, Comp comp = Comp{}, Proj proj = Proj{}) { auto n = __stl2::distance(first, __stl2::move(last)); @@ -60,7 +60,7 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sortable, Comp, Proj> + Sortable, Comp, Proj>() safe_iterator_t pop_heap(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/prev_permutation.hpp b/include/stl2/detail/algorithm/prev_permutation.hpp index c7bd1cb86..220da2500 100644 --- a/include/stl2/detail/algorithm/prev_permutation.hpp +++ b/include/stl2/detail/algorithm/prev_permutation.hpp @@ -35,7 +35,7 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::Sortable + Sortable() bool prev_permutation(I first, S last, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -66,7 +66,7 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sortable, Comp, Proj> + Sortable, Comp, Proj>() bool prev_permutation(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { return __stl2::prev_permutation(__stl2::begin(rng), __stl2::end(rng), diff --git a/include/stl2/detail/algorithm/push_heap.hpp b/include/stl2/detail/algorithm/push_heap.hpp index 445949f38..fa90cb939 100644 --- a/include/stl2/detail/algorithm/push_heap.hpp +++ b/include/stl2/detail/algorithm/push_heap.hpp @@ -34,8 +34,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sentinel<__f, I> && - models::Sortable + Sentinel<__f, I>() && + Sortable() I push_heap(I first, S&& last, Comp comp = Comp{}, Proj proj = Proj{}) { auto n = __stl2::distance(first, __stl2::forward(last)); @@ -45,7 +45,7 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sortable, Comp, Proj> + Sortable, Comp, Proj>() safe_iterator_t push_heap(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/random_access_sort.hpp b/include/stl2/detail/algorithm/random_access_sort.hpp index 01114d6f5..9a878f47f 100644 --- a/include/stl2/detail/algorithm/random_access_sort.hpp +++ b/include/stl2/detail/algorithm/random_access_sort.hpp @@ -30,7 +30,7 @@ STL2_OPEN_NAMESPACE { namespace rsort { template requires - models::Sortable + Sortable() I choose_pivot(I first, I last, Comp& comp, Proj& proj) { STL2_EXPECT(first != last); @@ -46,7 +46,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() I unguarded_partition(I first, I last, Comp& comp, Proj& proj) { I pivot_pnt = rsort::choose_pivot(first, last, comp, proj); @@ -72,7 +72,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() void unguarded_linear_insert(I last, value_type_t val, Comp& comp, Proj& proj) { I next = __stl2::prev(last); @@ -86,7 +86,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() void linear_insert(I first, I last, Comp& comp, Proj& proj) { value_type_t val = __stl2::iter_move(last); @@ -100,7 +100,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() void insertion_sort(I first, I last, Comp& comp, Proj& proj) { if (first != last) { @@ -112,7 +112,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() void unguarded_insertion_sort(I first, I last, Comp& comp, Proj& proj) { for (I i = first; i != last; ++i) { @@ -133,7 +133,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() void introsort_loop(I first, I last, difference_type_t depth_limit, Comp& comp, Proj& proj) { @@ -151,7 +151,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() void final_insertion_sort(I first, I last, Comp &comp, Proj &proj) { if (__stl2::distance(first, last) > introsort_threshold) { diff --git a/include/stl2/detail/algorithm/remove.hpp b/include/stl2/detail/algorithm/remove.hpp index ddf139a81..b575e09d6 100644 --- a/include/stl2/detail/algorithm/remove.hpp +++ b/include/stl2/detail/algorithm/remove.hpp @@ -25,9 +25,9 @@ STL2_OPEN_NAMESPACE { template S, class T, class Proj = identity> requires - models::Permutable && - models::IndirectRelation< - equal_to<>, projected, const T*> + Permutable() && + IndirectRelation< + equal_to<>, projected, const T*>() I remove(I first, S last, const T& value, Proj proj = Proj{}) { first = __stl2::find(__stl2::move(first), last, value, __stl2::ref(proj)); @@ -44,9 +44,9 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable> && - models::IndirectRelation< - equal_to<>, projected, Proj>, const T*> + Permutable>() && + IndirectRelation< + equal_to<>, projected, Proj>, const T*>() safe_iterator_t remove(Rng&& rng, const T& value, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/remove_copy.hpp b/include/stl2/detail/algorithm/remove_copy.hpp index 3b3eecb17..fd5e197cf 100644 --- a/include/stl2/detail/algorithm/remove_copy.hpp +++ b/include/stl2/detail/algorithm/remove_copy.hpp @@ -25,9 +25,9 @@ STL2_OPEN_NAMESPACE { template S, WeaklyIncrementable O, class T, class Proj = identity> requires - models::IndirectlyCopyable && - models::IndirectRelation< - equal_to<>, projected, const T*> + IndirectlyCopyable() && + IndirectRelation< + equal_to<>, projected, const T*>() tagged_pair remove_copy(I first, S last, O result, const T& value, Proj proj = Proj{}) { @@ -43,10 +43,10 @@ STL2_OPEN_NAMESPACE { template requires - models::WeaklyIncrementable<__f> && - models::IndirectlyCopyable, __f> && - models::IndirectRelation< - equal_to<>, projected, Proj>, const T*> + WeaklyIncrementable<__f>() && + IndirectlyCopyable, __f>() && + IndirectRelation< + equal_to<>, projected, Proj>, const T*>() tagged_pair), tag::out(__f)> remove_copy(Rng&& rng, O&& result, const T& value, Proj proj = Proj{}) { @@ -57,10 +57,10 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::WeaklyIncrementable<__f> && - models::IndirectlyCopyable> && - models::IndirectRelation< - equal_to<>, projected, const T*> + WeaklyIncrementable<__f>() && + IndirectlyCopyable>() && + IndirectRelation< + equal_to<>, projected, const T*>() tagged_pair), tag::out(__f)> remove_copy(std::initializer_list&& rng, O&& result, const T& value, Proj proj = Proj{}) diff --git a/include/stl2/detail/algorithm/remove_copy_if.hpp b/include/stl2/detail/algorithm/remove_copy_if.hpp index 962691bdf..7c7680918 100644 --- a/include/stl2/detail/algorithm/remove_copy_if.hpp +++ b/include/stl2/detail/algorithm/remove_copy_if.hpp @@ -25,9 +25,9 @@ STL2_OPEN_NAMESPACE { template S, WeaklyIncrementable O, class Pred, class Proj = identity> requires - models::IndirectlyCopyable && - models::IndirectPredicate< - Pred, projected> + IndirectlyCopyable() && + IndirectPredicate< + Pred, projected>() tagged_pair remove_copy_if(I first, S last, O result, Pred pred, Proj proj = Proj{}) { @@ -43,10 +43,10 @@ STL2_OPEN_NAMESPACE { template requires - models::WeaklyIncrementable<__f> && - models::IndirectlyCopyable, __f> && - models::IndirectPredicate< - Pred, projected, Proj>> + WeaklyIncrementable<__f>() && + IndirectlyCopyable, __f>() && + IndirectPredicate< + Pred, projected, Proj>>() tagged_pair), tag::out(__f)> remove_copy_if(Rng&& rng, O&& result, Pred pred, Proj proj = Proj{}) { @@ -58,10 +58,10 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::WeaklyIncrementable<__f> && - models::IndirectlyCopyable> && - models::IndirectPredicate< - Pred, projected> + WeaklyIncrementable<__f>() && + IndirectlyCopyable>() && + IndirectPredicate< + Pred, projected>() tagged_pair), tag::out(__f)> remove_copy_if(std::initializer_list&& rng, O&& result, Pred pred, Proj proj = Proj{}) diff --git a/include/stl2/detail/algorithm/remove_if.hpp b/include/stl2/detail/algorithm/remove_if.hpp index 9db2dec12..3a946bca5 100644 --- a/include/stl2/detail/algorithm/remove_if.hpp +++ b/include/stl2/detail/algorithm/remove_if.hpp @@ -24,9 +24,9 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class Proj = identity> requires - models::Permutable && - models::IndirectPredicate< - Pred, projected> + Permutable() && + IndirectPredicate< + Pred, projected>() I remove_if(I first, S last, Pred pred, Proj proj = Proj{}) { first = __stl2::find_if(__stl2::move(first), last, @@ -44,9 +44,9 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable> && - models::IndirectPredicate< - Pred, projected, Proj>> + Permutable>() && + IndirectPredicate< + Pred, projected, Proj>>() safe_iterator_t remove_if(Rng&& rng, Pred pred, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/replace.hpp b/include/stl2/detail/algorithm/replace.hpp index c05913430..8730a9231 100644 --- a/include/stl2/detail/algorithm/replace.hpp +++ b/include/stl2/detail/algorithm/replace.hpp @@ -24,9 +24,9 @@ STL2_OPEN_NAMESPACE { template S, class T1, class T2, class Proj = identity> requires - models::Writable && - models::IndirectRelation< - equal_to<>, projected, const T1*> + Writable() && + IndirectRelation< + equal_to<>, projected, const T1*>() I replace(I first, S last, const T1& old_value, const T2& new_value, Proj proj = Proj{}) { @@ -43,9 +43,9 @@ STL2_OPEN_NAMESPACE { // Extension: Relax to InputRange template requires - models::Writable, const T2&> && - models::IndirectRelation< - equal_to<>, projected, Proj>, const T1*> + Writable, const T2&>() && + IndirectRelation< + equal_to<>, projected, Proj>, const T1*>() safe_iterator_t replace(Rng&& rng, const T1& old_value, const T2& new_value, Proj proj = Proj{}) diff --git a/include/stl2/detail/algorithm/replace_copy.hpp b/include/stl2/detail/algorithm/replace_copy.hpp index 6367bfeee..6c449f929 100644 --- a/include/stl2/detail/algorithm/replace_copy.hpp +++ b/include/stl2/detail/algorithm/replace_copy.hpp @@ -23,9 +23,9 @@ STL2_OPEN_NAMESPACE { template S, class T1, class T2, OutputIterator O, class Proj = identity> requires - models::IndirectlyCopyable && - models::IndirectRelation< - equal_to<>, projected, const T1*> + IndirectlyCopyable() && + IndirectRelation< + equal_to<>, projected, const T1*>() tagged_pair replace_copy(I first, S last, O result, const T1& old_value, const T2& new_value, Proj proj = Proj{}) @@ -43,10 +43,10 @@ STL2_OPEN_NAMESPACE { template requires - models::OutputIterator<__f, const T2&> && - models::IndirectlyCopyable, __f> && - models::IndirectRelation< - equal_to<>, projected, Proj>, const T1*> + OutputIterator<__f, const T2&>() && + IndirectlyCopyable, __f>() && + IndirectRelation< + equal_to<>, projected, Proj>, const T1*>() tagged_pair), tag::out(__f)> replace_copy(Rng&& rng, O&& result, const T1& old_value, const T2& new_value, Proj proj = Proj{}) @@ -59,10 +59,10 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::OutputIterator<__f, const T2&> && - models::IndirectlyCopyable> && - models::IndirectRelation< - equal_to<>, projected, const T1*> + OutputIterator<__f, const T2&>() && + IndirectlyCopyable>() && + IndirectRelation< + equal_to<>, projected, const T1*>() tagged_pair), tag::out(__f)> replace_copy(std::initializer_list&& rng, O&& result, const T1& old_value, diff --git a/include/stl2/detail/algorithm/replace_copy_if.hpp b/include/stl2/detail/algorithm/replace_copy_if.hpp index 2d0147556..635732c2a 100644 --- a/include/stl2/detail/algorithm/replace_copy_if.hpp +++ b/include/stl2/detail/algorithm/replace_copy_if.hpp @@ -23,9 +23,9 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class T, OutputIterator O, class Proj = identity> requires - models::IndirectlyCopyable && - models::IndirectPredicate< - Pred, projected> + IndirectlyCopyable() && + IndirectPredicate< + Pred, projected>() tagged_pair replace_copy_if(I first, S last, O result, Pred pred, const T& new_value, Proj proj = Proj{}) @@ -43,10 +43,10 @@ STL2_OPEN_NAMESPACE { template requires - models::OutputIterator<__f, const T&> && - models::IndirectlyCopyable, __f> && - models::IndirectPredicate< - Pred, projected, Proj>> + OutputIterator<__f, const T&>() && + IndirectlyCopyable, __f>() && + IndirectPredicate< + Pred, projected, Proj>>() tagged_pair), tag::out(__f)> replace_copy_if(Rng&& rng, O&& result, Pred pred, const T& new_value, Proj proj = Proj{}) @@ -59,10 +59,10 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::OutputIterator<__f, const T&> && - models::IndirectlyCopyable> && - models::IndirectPredicate< - Pred, projected> + OutputIterator<__f, const T&>() && + IndirectlyCopyable>() && + IndirectPredicate< + Pred, projected>() tagged_pair), tag::out(__f)> replace_copy_if(std::initializer_list&& rng, O&& result, Pred pred, const T& new_value, Proj proj = Proj{}) diff --git a/include/stl2/detail/algorithm/replace_if.hpp b/include/stl2/detail/algorithm/replace_if.hpp index 3a4ca4f02..eac29f23f 100644 --- a/include/stl2/detail/algorithm/replace_if.hpp +++ b/include/stl2/detail/algorithm/replace_if.hpp @@ -23,9 +23,9 @@ STL2_OPEN_NAMESPACE { // Extension: Relax to InputIterator template S, class Pred, class T, class Proj = identity> requires - models::Writable && - models::IndirectPredicate< - Pred, projected> + Writable() && + IndirectPredicate< + Pred, projected>() I replace_if(I first, S last, Pred pred, const T& new_value, Proj proj = Proj{}) { if (first != last) { @@ -41,9 +41,9 @@ STL2_OPEN_NAMESPACE { // Extension: Relax to InputRange template requires - models::Writable, const T&> && - models::IndirectPredicate< - Pred, projected, Proj>> + Writable, const T&>() && + IndirectPredicate< + Pred, projected, Proj>>() safe_iterator_t replace_if(Rng&& rng, Pred pred, const T& new_value, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/reverse.hpp b/include/stl2/detail/algorithm/reverse.hpp index 5ac0bd9ae..541742c28 100644 --- a/include/stl2/detail/algorithm/reverse.hpp +++ b/include/stl2/detail/algorithm/reverse.hpp @@ -46,7 +46,7 @@ STL2_OPEN_NAMESPACE { // Complexity: n moves + n / 2 swaps template requires - models::Permutable + Permutable() I reverse_n_with_half_buffer(I first, const difference_type_t n, temporary_buffer>& buf) { @@ -75,7 +75,7 @@ STL2_OPEN_NAMESPACE { // From EoP template requires - models::Permutable + Permutable() I reverse_n_adaptive(I first, const difference_type_t n, temporary_buffer>& buf) { @@ -101,7 +101,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable + Permutable() I reverse_n(I first, difference_type_t n) { auto ufirst = ext::uncounted(first); @@ -116,7 +116,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable + Permutable() I reverse(I first, I last) { auto m = last; @@ -129,7 +129,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable + Permutable() I reverse(I first, I last) { if (first != last) { @@ -152,7 +152,7 @@ STL2_OPEN_NAMESPACE { template S> requires - models::BidirectionalIterator + BidirectionalIterator() I reverse(I first, S last) { auto bound = __stl2::next(first, __stl2::move(last)); @@ -162,7 +162,7 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::Permutable> + Permutable>() safe_iterator_t reverse(Rng&& rng) { return detail::reverse_n(__stl2::begin(rng), __stl2::distance(rng)); @@ -170,7 +170,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable> + Permutable>() safe_iterator_t reverse(Rng&& rng) { return __stl2::reverse(__stl2::begin(rng), __stl2::end(rng)); diff --git a/include/stl2/detail/algorithm/reverse_copy.hpp b/include/stl2/detail/algorithm/reverse_copy.hpp index 34d1e9e8c..4ba0bfc41 100644 --- a/include/stl2/detail/algorithm/reverse_copy.hpp +++ b/include/stl2/detail/algorithm/reverse_copy.hpp @@ -24,7 +24,7 @@ STL2_OPEN_NAMESPACE { template S, WeaklyIncrementable O> requires - models::IndirectlyCopyable + IndirectlyCopyable() tagged_pair reverse_copy(I first, S last, O result) { @@ -37,8 +37,8 @@ STL2_OPEN_NAMESPACE { template requires - models::WeaklyIncrementable<__f> && - models::IndirectlyCopyable, __f> + WeaklyIncrementable<__f>() && + IndirectlyCopyable, __f>() tagged_pair), tag::out(__f)> reverse_copy(Rng&& rng, O&& result) { @@ -49,8 +49,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::WeaklyIncrementable<__f> && - models::IndirectlyCopyable> + WeaklyIncrementable<__f>() && + IndirectlyCopyable>() tagged_pair), tag::out(__f)> reverse_copy(std::initializer_list&& rng, O&& result) { diff --git a/include/stl2/detail/algorithm/rotate.hpp b/include/stl2/detail/algorithm/rotate.hpp index b79607b31..2546d662e 100644 --- a/include/stl2/detail/algorithm/rotate.hpp +++ b/include/stl2/detail/algorithm/rotate.hpp @@ -38,7 +38,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable + Permutable() ext::range __rotate_left(I first, I last) { value_type_t tmp = __stl2::iter_move(first); @@ -49,7 +49,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable + Permutable() ext::range __rotate_right(I first, I last) { I lm1 = __stl2::prev(last); @@ -104,7 +104,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable + Permutable() ext::range __rotate_gcd(I first, I middle, I last) { using D = difference_type_t; @@ -204,7 +204,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable> + Permutable>() ext::range> rotate(Rng&& rng, iterator_t middle) { return __stl2::rotate(__stl2::begin(rng), __stl2::move(middle), __stl2::end(rng)); diff --git a/include/stl2/detail/algorithm/rotate_copy.hpp b/include/stl2/detail/algorithm/rotate_copy.hpp index 70d227746..fe43712ac 100644 --- a/include/stl2/detail/algorithm/rotate_copy.hpp +++ b/include/stl2/detail/algorithm/rotate_copy.hpp @@ -24,10 +24,10 @@ STL2_OPEN_NAMESPACE { template requires - models::Same> && - models::Sentinel<__f, I> && - models::WeaklyIncrementable<__f> && - models::IndirectlyCopyable> + Same>() && + Sentinel<__f, I>() && + WeaklyIncrementable<__f>() && + IndirectlyCopyable>() tagged_pair)> rotate_copy(F&& first, I middle, S&& last, O&& out) { @@ -39,9 +39,9 @@ STL2_OPEN_NAMESPACE { template requires - models::Same, __f> && - models::WeaklyIncrementable<__f> && - models::IndirectlyCopyable, __f> + Same, __f>() && + WeaklyIncrementable<__f>() && + IndirectlyCopyable, __f>() tagged_pair), tag::out(__f)> rotate_copy(Rng&& rng, M&& middle, O&& result) { @@ -52,8 +52,8 @@ STL2_OPEN_NAMESPACE { // Extension template requires - models::WeaklyIncrementable<__f> && - models::IndirectlyCopyable> + WeaklyIncrementable<__f>() && + IndirectlyCopyable>() tagged_pair), tag::out(__f)> rotate_copy(std::initializer_list&& rng, const E* middle, O&& result) { diff --git a/include/stl2/detail/algorithm/search.hpp b/include/stl2/detail/algorithm/search.hpp index e60aeb9e6..d79ff711a 100644 --- a/include/stl2/detail/algorithm/search.hpp +++ b/include/stl2/detail/algorithm/search.hpp @@ -38,8 +38,8 @@ STL2_OPEN_NAMESPACE { ForwardIterator I2, Sentinel S2, class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> requires - models::IndirectlyComparable< - I1, I2, Pred, Proj1, Proj2> + IndirectlyComparable< + I1, I2, Pred, Proj1, Proj2>() I1 unsized(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred, Proj1 proj1, Proj2 proj2) { @@ -72,8 +72,8 @@ STL2_OPEN_NAMESPACE { ForwardIterator I2, Sentinel S2, class Pred, class Proj1, class Proj2> requires - models::IndirectlyComparable< - I1, I2, Pred, Proj1, Proj2> + IndirectlyComparable< + I1, I2, Pred, Proj1, Proj2>() I1 sized( const I1 first1_, S1 last1, const difference_type_t d1_, I2 first2, S2 last2, const difference_type_t d2, @@ -104,8 +104,8 @@ STL2_OPEN_NAMESPACE { ForwardIterator I2, Sentinel S2, class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> requires - models::IndirectlyComparable< - I1, I2, Pred, Proj1, Proj2> + IndirectlyComparable< + I1, I2, Pred, Proj1, Proj2>() I1 search(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -119,10 +119,10 @@ STL2_OPEN_NAMESPACE { ForwardIterator I2, Sentinel S2, class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> requires - models::SizedSentinel && - models::SizedSentinel && - models::IndirectlyComparable< - I1, I2, Pred, Proj1, Proj2> + SizedSentinel() && + SizedSentinel() && + IndirectlyComparable< + I1, I2, Pred, Proj1, Proj2>() I1 search(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -136,8 +136,8 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectlyComparable< - iterator_t, iterator_t, Pred, Proj1, Proj2> + IndirectlyComparable< + iterator_t, iterator_t, Pred, Proj1, Proj2>() safe_iterator_t search(Rng1&& rng1, Rng2&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -152,9 +152,9 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::SizedRange && models::SizedRange && - models::IndirectlyComparable< - iterator_t, iterator_t, Pred, Proj1, Proj2> + SizedRange() && SizedRange() && + IndirectlyComparable< + iterator_t, iterator_t, Pred, Proj1, Proj2>() safe_iterator_t search(Rng1&& rng1, Rng2&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) { @@ -169,8 +169,8 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectlyComparable< - const E*, iterator_t, Pred, Proj1, Proj2> + IndirectlyComparable< + const E*, iterator_t, Pred, Proj1, Proj2>() dangling search(std::initializer_list&& rng1, Rng2&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -183,8 +183,8 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectlyComparable< - iterator_t, const E*, Pred, Proj1, Proj2> + IndirectlyComparable< + iterator_t, const E*, Pred, Proj1, Proj2>() safe_iterator_t search(Rng1&& rng1, std::initializer_list&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -197,8 +197,8 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::IndirectlyComparable< - const E1*, const E2*, Pred, Proj1, Proj2> + IndirectlyComparable< + const E1*, const E2*, Pred, Proj1, Proj2>() dangling search(std::initializer_list&& rng1, std::initializer_list&& rng2, Pred pred = Pred{}, diff --git a/include/stl2/detail/algorithm/search_n.hpp b/include/stl2/detail/algorithm/search_n.hpp index 902a3d588..f7b308eb0 100644 --- a/include/stl2/detail/algorithm/search_n.hpp +++ b/include/stl2/detail/algorithm/search_n.hpp @@ -36,7 +36,7 @@ STL2_OPEN_NAMESPACE { namespace __search_n { template S, class T, class Pred, class Proj> requires - models::IndirectlyComparable + IndirectlyComparable() I unsized(I first, S last, difference_type_t count, const T& value, Pred pred, Proj proj) { @@ -64,7 +64,7 @@ STL2_OPEN_NAMESPACE { template S, class T, class Pred, class Proj> requires - models::IndirectlyComparable + IndirectlyComparable() I sized(I first_, S last, difference_type_t d_, difference_type_t count, const T& value, Pred pred, Proj proj) @@ -100,7 +100,7 @@ STL2_OPEN_NAMESPACE { template S, class T, class Pred = equal_to<>, class Proj = identity> requires - models::IndirectlyComparable + IndirectlyComparable() I search_n(I first, S last, difference_type_t count, const T& value, Pred pred = Pred{}, Proj proj = Proj{}) { @@ -111,8 +111,8 @@ STL2_OPEN_NAMESPACE { template S, class T, class Pred = equal_to<>, class Proj = identity> requires - models::SizedSentinel && - models::IndirectlyComparable + SizedSentinel() && + IndirectlyComparable() I search_n(I first, S last, difference_type_t count, const T& value, Pred pred = Pred{}, Proj proj = Proj{}) { @@ -123,8 +123,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectlyComparable< - iterator_t, const T*, Pred, Proj> + IndirectlyComparable< + iterator_t, const T*, Pred, Proj>() safe_iterator_t search_n(Rng&& rng, difference_type_t> count, const T& value, Pred pred = Pred{}, Proj proj = Proj{}) @@ -136,9 +136,9 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::SizedRange && - models::IndirectlyComparable< - iterator_t, const T*, Pred, Proj> + SizedRange() && + IndirectlyComparable< + iterator_t, const T*, Pred, Proj>() safe_iterator_t search_n(Rng&& rng, difference_type_t> count, const T& value, Pred pred = Pred{}, Proj proj = Proj{}) @@ -151,8 +151,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectlyComparable< - const E*, const T*, Pred, Proj> + IndirectlyComparable< + const E*, const T*, Pred, Proj>() dangling search_n(std::initializer_list&& rng, std::ptrdiff_t count, const T& value, Pred pred = Pred{}, Proj proj = Proj{}) diff --git a/include/stl2/detail/algorithm/set_difference.hpp b/include/stl2/detail/algorithm/set_difference.hpp index 49a7082d1..b21b0f566 100644 --- a/include/stl2/detail/algorithm/set_difference.hpp +++ b/include/stl2/detail/algorithm/set_difference.hpp @@ -28,7 +28,7 @@ STL2_OPEN_NAMESPACE { WeaklyIncrementable O, class Comp = less<>, class Proj1 = identity, class Proj2 = identity> requires - models::Mergeable + Mergeable() tagged_pair set_difference(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -56,10 +56,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< iterator_t, iterator_t, - __f, Comp, Proj1, Proj2> + __f, Comp, Proj1, Proj2>() tagged_pair), tag::out(__f)> set_difference(Rng1&& rng1, Rng2&& rng2, O&& result, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -74,10 +74,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< const E*, iterator_t, - __f, Comp, Proj1, Proj2> + __f, Comp, Proj1, Proj2>() tagged_pair), tag::out(__f)> set_difference(std::initializer_list&& rng1, Rng2&& rng2, O&& result, Comp comp = Comp{}, @@ -93,10 +93,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< iterator_t, const E*, - __f, Comp, Proj1, Proj2> + __f, Comp, Proj1, Proj2>() tagged_pair), tag::out(__f)> set_difference(Rng1&& rng1, std::initializer_list&& rng2, O&& result, Comp comp = Comp{}, @@ -112,10 +112,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< const E1*, const E2*, - __f, Comp, Proj1, Proj2> + __f, Comp, Proj1, Proj2>() tagged_pair), tag::out(__f)> set_difference(std::initializer_list&& rng1, std::initializer_list&& rng2, diff --git a/include/stl2/detail/algorithm/set_intersection.hpp b/include/stl2/detail/algorithm/set_intersection.hpp index d8be42a5e..e2c2bf6ef 100644 --- a/include/stl2/detail/algorithm/set_intersection.hpp +++ b/include/stl2/detail/algorithm/set_intersection.hpp @@ -27,7 +27,7 @@ STL2_OPEN_NAMESPACE { WeaklyIncrementable O, class Comp = less<>, class Proj1 = identity, class Proj2 = identity> requires - models::Mergeable + Mergeable() O set_intersection(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -54,10 +54,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< iterator_t, iterator_t, __f, - Comp, Proj1, Proj2> + Comp, Proj1, Proj2>() __f set_intersection(Rng1&& rng1, Rng2&& rng2, O&& result, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -72,10 +72,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< const E*, iterator_t, __f, - Comp, Proj1, Proj2> + Comp, Proj1, Proj2>() __f set_intersection(std::initializer_list&& rng1, Rng2&& rng2, O&& result, Comp comp = Comp{}, @@ -91,10 +91,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< iterator_t, const E*, __f, - Comp, Proj1, Proj2> + Comp, Proj1, Proj2>() __f set_intersection(Rng1&& rng1, std::initializer_list&& rng2, O&& result, Comp comp = Comp{}, @@ -110,10 +110,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< const E1*, const E2*, __f, - Comp, Proj1, Proj2> + Comp, Proj1, Proj2>() __f set_intersection(std::initializer_list&& rng1, std::initializer_list&& rng2, O&& result, Comp comp = Comp{}, diff --git a/include/stl2/detail/algorithm/set_symmetric_difference.hpp b/include/stl2/detail/algorithm/set_symmetric_difference.hpp index 7e9d4fdf5..7f814246a 100644 --- a/include/stl2/detail/algorithm/set_symmetric_difference.hpp +++ b/include/stl2/detail/algorithm/set_symmetric_difference.hpp @@ -28,7 +28,7 @@ STL2_OPEN_NAMESPACE { WeaklyIncrementable O, class Comp = less<>, class Proj1 = identity, class Proj2 = identity> requires - models::Mergeable + Mergeable() tagged_tuple set_symmetric_difference( I1 first1, S1 last1, I2 first2, S2 last2, O result, @@ -73,10 +73,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< iterator_t, iterator_t, - __f, Comp, Proj1, Proj2> + __f, Comp, Proj1, Proj2>() tagged_tuple), tag::in2(safe_iterator_t), tag::out(__f)> set_symmetric_difference(Rng1&& rng1, Rng2&& rng2, O&& result, @@ -92,10 +92,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< const E*, iterator_t, - __f, Comp, Proj1, Proj2> + __f, Comp, Proj1, Proj2>() tagged_tuple), tag::in2(safe_iterator_t), tag::out(__f)> set_symmetric_difference(std::initializer_list&& rng1, Rng2&& rng2, O&& result, @@ -111,10 +111,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< iterator_t, const E*, - __f, Comp, Proj1, Proj2> + __f, Comp, Proj1, Proj2>() tagged_tuple), tag::in2(dangling), tag::out(__f)> set_symmetric_difference(Rng1&& rng1, std::initializer_list&& rng2, O&& result, @@ -130,10 +130,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< const E1*, const E2*, - __f, Comp, Proj1, Proj2> + __f, Comp, Proj1, Proj2>() tagged_tuple), tag::in2(dangling), tag::out(__f)> set_symmetric_difference(std::initializer_list&& rng1, diff --git a/include/stl2/detail/algorithm/set_union.hpp b/include/stl2/detail/algorithm/set_union.hpp index 3addf2f0c..c321dbf6b 100644 --- a/include/stl2/detail/algorithm/set_union.hpp +++ b/include/stl2/detail/algorithm/set_union.hpp @@ -28,7 +28,7 @@ STL2_OPEN_NAMESPACE { WeaklyIncrementable O, class Comp = less<>, class Proj1 = identity, class Proj2 = identity> requires - models::Mergeable + Mergeable() tagged_tuple set_union(I1 first1, S1 last1, I2 first2, S2 last2, O result, Comp comp = Comp{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -67,10 +67,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< iterator_t, iterator_t, __f, - Comp, Proj1, Proj2> + Comp, Proj1, Proj2>() tagged_tuple), tag::in2(safe_iterator_t), tag::out(__f)> set_union(Rng1&& rng1, Rng2&& rng2, O&& result, Comp comp = Comp{}, @@ -87,10 +87,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< const E*, iterator_t, __f, - Comp, Proj1, Proj2> + Comp, Proj1, Proj2>() tagged_tuple), tag::in2(safe_iterator_t), tag::out(__f)> set_union(std::initializer_list&& rng1, Rng2&& rng2, O&& result, @@ -107,10 +107,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< iterator_t, const E*, __f, - Comp, Proj1, Proj2> + Comp, Proj1, Proj2>() tagged_tuple), tag::in2(dangling), tag::out(__f)> set_union(Rng1&& rng1, std::initializer_list&& rng2, O&& result, @@ -127,10 +127,10 @@ STL2_OPEN_NAMESPACE { template , class Proj1 = identity, class Proj2 = identity> requires - models::WeaklyIncrementable<__f> && - models::Mergeable< + WeaklyIncrementable<__f>() && + Mergeable< const E1*, const E2*, __f, - Comp, Proj1, Proj2> + Comp, Proj1, Proj2>() tagged_tuple), tag::in2(dangling), tag::out(__f)> set_union(std::initializer_list&& rng1, diff --git a/include/stl2/detail/algorithm/shuffle.hpp b/include/stl2/detail/algorithm/shuffle.hpp index 6c46b4983..ff387d583 100644 --- a/include/stl2/detail/algorithm/shuffle.hpp +++ b/include/stl2/detail/algorithm/shuffle.hpp @@ -27,9 +27,9 @@ STL2_OPEN_NAMESPACE { template S, class Gen = detail::default_random_engine&, class D = difference_type_t> requires - models::Permutable && - models::UniformRandomNumberGenerator> && - models::ConvertibleTo, D> + Permutable() && + UniformRandomNumberGenerator>() && + ConvertibleTo, D>() I shuffle(I const first, S const last, Gen&& g = detail::get_random_engine()) { auto mid = first; @@ -49,9 +49,9 @@ STL2_OPEN_NAMESPACE { template >> requires - models::Permutable> && - models::UniformRandomNumberGenerator> && - models::ConvertibleTo, D> + Permutable>() && + UniformRandomNumberGenerator>() && + ConvertibleTo, D>() inline safe_iterator_t shuffle( Rng&& rng, Gen&& g = detail::get_random_engine()) { diff --git a/include/stl2/detail/algorithm/sort.hpp b/include/stl2/detail/algorithm/sort.hpp index 8e8bed463..1025884e6 100644 --- a/include/stl2/detail/algorithm/sort.hpp +++ b/include/stl2/detail/algorithm/sort.hpp @@ -27,7 +27,7 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::Sortable + Sortable() I sort(I first, S last, Comp comp = Comp{}, Proj proj = Proj{}) { auto n = __stl2::distance(first, __stl2::move(last)); @@ -38,7 +38,7 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::Sortable + Sortable() I sort(I first, S sent, Comp comp = Comp{}, Proj proj = Proj{}) { if (first == sent) { @@ -54,7 +54,7 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sortable, Comp, Proj> + Sortable, Comp, Proj>() safe_iterator_t sort(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -64,7 +64,7 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sortable, Comp, Proj> + Sortable, Comp, Proj>() safe_iterator_t sort(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/sort_heap.hpp b/include/stl2/detail/algorithm/sort_heap.hpp index e8cf64780..76f81d7ce 100644 --- a/include/stl2/detail/algorithm/sort_heap.hpp +++ b/include/stl2/detail/algorithm/sort_heap.hpp @@ -35,7 +35,7 @@ STL2_OPEN_NAMESPACE { namespace detail { template requires - models::Sortable + Sortable() void sort_heap_n(I first, difference_type_t n, Comp comp, Proj proj) { if (n < 2) { @@ -51,7 +51,7 @@ STL2_OPEN_NAMESPACE { template S, class Comp = less<>, class Proj = identity> requires - models::Sortable + Sortable() I sort_heap(I first, S last, Comp comp = Comp{}, Proj proj = Proj{}) { auto n = __stl2::distance(first, __stl2::move(last)); @@ -61,7 +61,7 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sortable, Comp, Proj> + Sortable, Comp, Proj>() safe_iterator_t sort_heap(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/stable_partition.hpp b/include/stl2/detail/algorithm/stable_partition.hpp index 790f99a67..f662a1907 100644 --- a/include/stl2/detail/algorithm/stable_partition.hpp +++ b/include/stl2/detail/algorithm/stable_partition.hpp @@ -49,7 +49,7 @@ STL2_OPEN_NAMESPACE { template > Pred> requires - models::Permutable + Permutable() ext::range forward_buffer(I first, I next, difference_type_t n, buf_t& buf, Pred& pred, Proj& proj) @@ -75,7 +75,7 @@ STL2_OPEN_NAMESPACE { template > Pred> requires - models::Permutable + Permutable() ext::range forward_reduce(I first, difference_type_t n, buf_t& buf, Pred& pred, Proj& proj); @@ -83,7 +83,7 @@ STL2_OPEN_NAMESPACE { template > Pred> requires - models::Permutable + Permutable() ext::range forward(I first, difference_type_t n, buf_t& buf, Pred& pred, Proj& proj) @@ -114,7 +114,7 @@ STL2_OPEN_NAMESPACE { template > Pred> requires - models::Permutable + Permutable() ext::range forward_reduce(I first, difference_type_t n, buf_t& buf, Pred& pred, Proj& proj) @@ -146,7 +146,7 @@ STL2_OPEN_NAMESPACE { template > Pred> requires - models::Permutable + Permutable() I bidirectional_buffer(I first, I last, difference_type_t n, buf_t& buf, Pred& pred, Proj& proj) { @@ -177,21 +177,21 @@ STL2_OPEN_NAMESPACE { template > Pred> requires - models::Permutable + Permutable() I bidirectional_reduce_front(I first, I last, difference_type_t n, buf_t& buf, Pred& pred, Proj& proj); template > Pred> requires - models::Permutable + Permutable() I bidirectional_reduce_back(I first, I last, difference_type_t n, buf_t& buf, Pred& pred, Proj& proj); template > Pred> requires - models::Permutable + Permutable() I bidirectional(I first, I last, difference_type_t n, buf_t& buf, Pred& pred, Proj& proj) { @@ -225,7 +225,7 @@ STL2_OPEN_NAMESPACE { template > Pred> requires - models::Permutable + Permutable() I bidirectional_reduce_front(I first, I last, difference_type_t n, buf_t& buf, Pred& pred, Proj& proj) { @@ -243,7 +243,7 @@ STL2_OPEN_NAMESPACE { template > Pred> requires - models::Permutable + Permutable() I bidirectional_reduce_back(I first, I last, difference_type_t n, buf_t& buf, Pred& pred, Proj& proj) { @@ -263,9 +263,9 @@ STL2_OPEN_NAMESPACE { namespace ext { template requires - models::Permutable && - models::IndirectPredicate< - Pred, projected> + Permutable() && + IndirectPredicate< + Pred, projected>() I stable_partition_n(I first, difference_type_t n, Pred pred, Proj proj = Proj{}) { @@ -287,9 +287,9 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable && - models::IndirectPredicate< - Pred, projected> + Permutable() && + IndirectPredicate< + Pred, projected>() I stable_partition_n(I first, I last, difference_type_t n, Pred pred, Proj proj = Proj{}) { @@ -319,9 +319,9 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable && - models::IndirectPredicate< - Pred, projected> + Permutable() && + IndirectPredicate< + Pred, projected>() I stable_partition_n(I first, difference_type_t n, Pred pred, Proj proj = Proj{}) { @@ -334,9 +334,9 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class Proj = identity> requires - models::Permutable && - models::IndirectPredicate< - Pred, projected> + Permutable() && + IndirectPredicate< + Pred, projected>() I stable_partition(I first, S last, Pred pred, Proj proj = Proj{}) { auto n = __stl2::distance(first, __stl2::move(last)); @@ -348,9 +348,9 @@ STL2_OPEN_NAMESPACE { template S, class Pred, class Proj = identity> requires - models::Permutable && - models::IndirectPredicate< - Pred, projected> + Permutable() && + IndirectPredicate< + Pred, projected>() I stable_partition(I first, S last, Pred pred, Proj proj = Proj{}) { auto bound = ext::enumerate(first, __stl2::move(last)); @@ -361,9 +361,9 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable> && - models::IndirectPredicate< - Pred, projected, Proj>> + Permutable>() && + IndirectPredicate< + Pred, projected, Proj>>() safe_iterator_t stable_partition(Rng&& rng, Pred pred, Proj proj = Proj{}) { @@ -374,9 +374,9 @@ STL2_OPEN_NAMESPACE { template requires - models::Permutable> && - models::IndirectPredicate< - Pred, projected, Proj>> + Permutable>() && + IndirectPredicate< + Pred, projected, Proj>>() safe_iterator_t stable_partition(Rng&& rng, Pred pred, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/stable_sort.hpp b/include/stl2/detail/algorithm/stable_sort.hpp index 032b08d29..66c8293ac 100644 --- a/include/stl2/detail/algorithm/stable_sort.hpp +++ b/include/stl2/detail/algorithm/stable_sort.hpp @@ -58,7 +58,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() void inplace_stable_sort(I first, I last, C &pred, P &proj) { if (last - first < 15) { @@ -75,7 +75,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() void merge_sort_loop(I first, I last, O result, difference_type_t step_size, C &pred, P &proj) { @@ -102,7 +102,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() void chunk_insertion_sort(I first, I last, difference_type_t chunk_size, C &comp, P &proj) { @@ -115,7 +115,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() void merge_sort_with_buffer(I first, I last, buf_t& buf, C &comp, P &proj) { auto len = difference_type_t(last - first); @@ -140,7 +140,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sortable + Sortable() void stable_sort_adaptive(I first, I last, buf_t& buf, C &comp, P &proj) { auto len = difference_type_t((last - first + 1) / 2); @@ -162,8 +162,8 @@ STL2_OPEN_NAMESPACE { // Extension: Supports forward iterators. template , class Proj = identity> requires - models::Sentinel<__f, I> && - models::Sortable + Sentinel<__f, I>() && + Sortable() I stable_sort(I first, S&& last, Comp comp = Comp{}, Proj proj = Proj{}) { auto n = __stl2::distance(first, __stl2::forward(last)); @@ -174,8 +174,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sentinel<__f, I> && - models::Sortable + Sentinel<__f, I>() && + Sortable() I stable_sort(I first, S&& last_, Comp comp = Comp{}, Proj proj = Proj{}) { auto last = __stl2::next(first, __stl2::forward(last_)); @@ -193,7 +193,7 @@ STL2_OPEN_NAMESPACE { // Extension: supports forward ranges. template , class Proj = identity> requires - models::Sortable, Comp, Proj> + Sortable, Comp, Proj>() safe_iterator_t stable_sort(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -203,7 +203,7 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Sortable, Comp, Proj> + Sortable, Comp, Proj>() safe_iterator_t stable_sort(Rng&& rng, Comp comp = Comp{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/swap_ranges.hpp b/include/stl2/detail/algorithm/swap_ranges.hpp index 844a97aa0..ccf3e33e1 100644 --- a/include/stl2/detail/algorithm/swap_ranges.hpp +++ b/include/stl2/detail/algorithm/swap_ranges.hpp @@ -23,7 +23,7 @@ STL2_OPEN_NAMESPACE { namespace __swap_ranges { template S1, ForwardIterator I2> requires - models::IndirectlySwappable + IndirectlySwappable() constexpr tagged_pair impl(I1 first1, S1 last1, I2 first2) { @@ -38,10 +38,10 @@ STL2_OPEN_NAMESPACE { [[deprecated]] tagged_pair), tag::in2(__f)> swap_ranges(I1&& first1, S1&& last1, I2&& first2) requires - models::ForwardIterator<__f> && - models::Sentinel<__f, __f> && - models::ForwardIterator<__f> && - models::IndirectlySwappable<__f, __f> + ForwardIterator<__f>() && + Sentinel<__f, __f>() && + ForwardIterator<__f>() && + IndirectlySwappable<__f, __f>() { return __swap_ranges::impl( std::forward(first1), std::forward(last1), @@ -53,8 +53,8 @@ STL2_OPEN_NAMESPACE { swap_ranges(Rng&& rng1, I&& first2_) requires !is_array>::value && - models::ForwardIterator<__f> && - models::IndirectlySwappable, __f> + ForwardIterator<__f>() && + IndirectlySwappable, __f>() { auto first2 = std::forward(first2_); return __swap_ranges::impl(__stl2::begin(rng1), __stl2::end(rng1), std::move(first2)); @@ -63,7 +63,7 @@ STL2_OPEN_NAMESPACE { template S1, ForwardIterator I2, Sentinel S2> requires - models::IndirectlySwappable + IndirectlySwappable() tagged_pair swap_ranges(I1 first1, S1 last1, I2 first2, S2 last2) { @@ -75,7 +75,7 @@ STL2_OPEN_NAMESPACE { template requires - models::IndirectlySwappable, iterator_t> + IndirectlySwappable, iterator_t>() tagged_pair), tag::in2(safe_iterator_t)> swap_ranges(Rng1&& rng1, Rng2&& rng2) diff --git a/include/stl2/detail/algorithm/transform.hpp b/include/stl2/detail/algorithm/transform.hpp index 034a01bf4..db441e292 100644 --- a/include/stl2/detail/algorithm/transform.hpp +++ b/include/stl2/detail/algorithm/transform.hpp @@ -27,8 +27,8 @@ STL2_OPEN_NAMESPACE { template S, WeaklyIncrementable O, CopyConstructible F, class Proj = identity> requires - models::Writable)>> + Writable)>>() tagged_pair transform(I first, S last, O result, F op, Proj proj = Proj{}) { @@ -40,8 +40,8 @@ STL2_OPEN_NAMESPACE { template requires - models::Writable, Proj>)>> + Writable, Proj>)>>() tagged_pair), tag::out(O)> transform(R&& r, O result, F op, Proj proj = Proj{}) { @@ -57,10 +57,10 @@ STL2_OPEN_NAMESPACE { transform(I1 first1, S1 last1, I2 first2, O result, F op, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) requires - models::Writable, - projected)>> + projected)>>() { for (; first1 != last1; ++first1, ++first2, ++result) { *result = __stl2::invoke(op, __stl2::invoke(proj1, *first1), __stl2::invoke(proj2, *first2)); @@ -77,11 +77,11 @@ STL2_OPEN_NAMESPACE { Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) requires !is_array>::value && - models::InputIterator<__f> && - models::Writable>() && + Writable, Proj1>, - projected<__f, Proj2>)>> + projected<__f, Proj2>)>>() { auto first2 = std::forward(first2_); return __stl2::transform( @@ -96,10 +96,10 @@ STL2_OPEN_NAMESPACE { WeaklyIncrementable O, CopyConstructible F, class Proj1 = identity, class Proj2 = identity> requires - models::Writable, - projected)>> + projected)>>() tagged_tuple transform(I1 first1, S1 last1, I2 first2, S2 last2, O result, F op, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}) @@ -113,10 +113,10 @@ STL2_OPEN_NAMESPACE { template requires - models::Writable, Proj1>, - projected, Proj2>)>> + projected, Proj2>)>>() tagged_tuple< tag::in1(safe_iterator_t), tag::in2(safe_iterator_t), diff --git a/include/stl2/detail/algorithm/unique.hpp b/include/stl2/detail/algorithm/unique.hpp index 68a09f642..e5f63f7f5 100644 --- a/include/stl2/detail/algorithm/unique.hpp +++ b/include/stl2/detail/algorithm/unique.hpp @@ -26,8 +26,8 @@ STL2_OPEN_NAMESPACE { template S, class R = equal_to<>, class Proj = identity> requires - models::Permutable && - models::IndirectRelation<__f, projected> + Permutable() && + IndirectRelation<__f, projected>() I unique(I first, S last, R comp = R{}, Proj proj = Proj{}) { first = __stl2::adjacent_find( @@ -45,9 +45,9 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::Permutable> && - models::IndirectRelation< - __f, projected, Proj>> + Permutable>() && + IndirectRelation< + __f, projected, Proj>>() safe_iterator_t unique(Rng&& rng, R comp = R{}, Proj proj = Proj{}) { diff --git a/include/stl2/detail/algorithm/unique_copy.hpp b/include/stl2/detail/algorithm/unique_copy.hpp index 09e958c28..dc355e2c9 100644 --- a/include/stl2/detail/algorithm/unique_copy.hpp +++ b/include/stl2/detail/algorithm/unique_copy.hpp @@ -84,20 +84,20 @@ STL2_OPEN_NAMESPACE { template constexpr bool __unique_copy_req = - models::IndirectlyCopyable && - (models::ForwardIterator || - models::ForwardIterator || - models::IndirectlyCopyableStorable); + IndirectlyCopyable() && + (ForwardIterator() || + ForwardIterator() || + IndirectlyCopyableStorable()); template , class Proj = identity> requires - models::InputIterator<__f> && - models::Sentinel<__f, __f> && - models::WeaklyIncrementable<__f> && + InputIterator<__f>() && + Sentinel<__f, __f>() && + WeaklyIncrementable<__f>() && __unique_copy_req<__f, __f> && - models::IndirectRelation< - __f, projected<__f, Proj>> + IndirectRelation< + __f, projected<__f, Proj>>() tagged_pair), tag::out(__f)> unique_copy(I&& first, S&& last, O&& result, R comp = R{}, Proj proj = Proj{}) @@ -114,10 +114,10 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::WeaklyIncrementable<__f> && + WeaklyIncrementable<__f>() && __unique_copy_req, __f> && - models::IndirectRelation< - __f, projected, Proj>> + IndirectRelation< + __f, projected, Proj>>() tagged_pair), tag::out(__f)> unique_copy(Rng&& rng, O&& result, R comp = R{}, Proj proj = Proj{}) { @@ -133,10 +133,10 @@ STL2_OPEN_NAMESPACE { // Extension template , class Proj = identity> requires - models::WeaklyIncrementable<__f> && + WeaklyIncrementable<__f>() && __unique_copy_req> && - models::IndirectRelation< - __f, projected> + IndirectRelation< + __f, projected>() tagged_pair), tag::out(__f)> unique_copy(std::initializer_list&& rng, O&& result, R comp = R{}, Proj proj = Proj{}) diff --git a/include/stl2/detail/algorithm/upper_bound.hpp b/include/stl2/detail/algorithm/upper_bound.hpp index 04d5b57f2..e5aa33a89 100644 --- a/include/stl2/detail/algorithm/upper_bound.hpp +++ b/include/stl2/detail/algorithm/upper_bound.hpp @@ -38,9 +38,9 @@ STL2_OPEN_NAMESPACE { namespace ext { template , class Proj = identity> requires - models::ForwardIterator<__f> && - models::IndirectStrictWeakOrder< - Comp, const T*, projected<__f, Proj>> + ForwardIterator<__f>() && + IndirectStrictWeakOrder< + Comp, const T*, projected<__f, Proj>>() __f upper_bound_n(I&& first, difference_type_t<__f> n, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -52,10 +52,10 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::ForwardIterator<__f> && - models::Sentinel<__f, __f> && - models::IndirectStrictWeakOrder< - Comp, const T*, projected<__f, Proj>> + ForwardIterator<__f>() && + Sentinel<__f, __f>() && + IndirectStrictWeakOrder< + Comp, const T*, projected<__f, Proj>>() __f upper_bound(I&& first, S&& last, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -67,11 +67,11 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::SizedSentinel<__f, __f> && - models::ForwardIterator<__f> && - models::Sentinel<__f, __f> && - models::IndirectStrictWeakOrder< - Comp, const T*, projected<__f, Proj>> + SizedSentinel<__f, __f>() && + ForwardIterator<__f>() && + Sentinel<__f, __f>() && + IndirectStrictWeakOrder< + Comp, const T*, projected<__f, Proj>>() __f upper_bound(I&& first_, S&& last, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) { @@ -83,8 +83,8 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, const T*, projected, Proj>> + IndirectStrictWeakOrder< + Comp, const T*, projected, Proj>>() safe_iterator_t upper_bound(Rng&& rng, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) @@ -95,9 +95,9 @@ STL2_OPEN_NAMESPACE { template , class Proj = identity> requires - models::SizedRange && - models::IndirectStrictWeakOrder< - Comp, const T*, projected, Proj>> + SizedRange() && + IndirectStrictWeakOrder< + Comp, const T*, projected, Proj>>() safe_iterator_t upper_bound(Rng&& rng, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) @@ -109,8 +109,8 @@ STL2_OPEN_NAMESPACE { // Extension template , class Proj = identity> requires - models::IndirectStrictWeakOrder< - Comp, const T*, projected> + IndirectStrictWeakOrder< + Comp, const T*, projected>() dangling upper_bound(std::initializer_list&& rng, const T& value, Comp comp = Comp{}, Proj proj = Proj{}) diff --git a/include/stl2/detail/cheap_storage.hpp b/include/stl2/detail/cheap_storage.hpp index 32c079d8c..991bee8c2 100644 --- a/include/stl2/detail/cheap_storage.hpp +++ b/include/stl2/detail/cheap_storage.hpp @@ -27,14 +27,14 @@ STL2_OPEN_NAMESPACE { constexpr bool cheaply_copyable = false; template requires - models::CopyConstructible && + CopyConstructible() && std::is_trivially_copyable::value && ((_Is && !_Is) || sizeof(T) <= cheap_copy_size) constexpr bool cheaply_copyable = true; template - requires models::Addressable + requires ext::Addressable() class ref_box { public: ref_box() = default; @@ -52,7 +52,7 @@ STL2_OPEN_NAMESPACE { // Note: promotes to CopyConstructible template - requires models::Addressable + requires ext::Addressable() using cheap_reference_box_t = meta::if_c< cheaply_copyable>, ebo_box, Tag>, diff --git a/include/stl2/detail/concepts/callable.hpp b/include/stl2/detail/concepts/callable.hpp index e30aa9e5c..a534e8a36 100644 --- a/include/stl2/detail/concepts/callable.hpp +++ b/include/stl2/detail/concepts/callable.hpp @@ -89,7 +89,7 @@ STL2_OPEN_NAMESPACE { // See https://github.com/ericniebler/stl2/issues/238 template requires - models::Invocable...> + Invocable...>() struct indirect_result_of : result_of...)> {}; diff --git a/include/stl2/detail/concepts/compare.hpp b/include/stl2/detail/concepts/compare.hpp index 521b7e929..d63587a23 100644 --- a/include/stl2/detail/concepts/compare.hpp +++ b/include/stl2/detail/concepts/compare.hpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include ///////////////////////////////////////////// // Comparison Concepts [concepts.lib.compare] @@ -25,39 +25,36 @@ STL2_OPEN_NAMESPACE { /////////////////////////////////////////////////////////////////////////// // Boolean [concepts.lib.compare.boolean] + // Not to spec: see https://github.com/ericniebler/stl2/issues/155 // - template - constexpr bool __boolean = false; - template - requires requires(const B& b1, const B& b2, const bool a) { - // Requirements common to both Boolean and BooleanTestable. - STL2_BINARY_DEDUCTION_CONSTRAINT(b1, ConvertibleTo, bool); - STL2_BINARY_DEDUCTION_CONSTRAINT(!b1, ConvertibleTo, bool); - STL2_EXACT_TYPE_CONSTRAINT(b1 && a, bool); - STL2_EXACT_TYPE_CONSTRAINT(b1 || a, bool); - - // Requirements of Boolean that are also be valid for - // BooleanTestable, but for which BooleanTestable does not - // require validation. - STL2_EXACT_TYPE_CONSTRAINT(b1 && b2, bool); - STL2_EXACT_TYPE_CONSTRAINT(a && b2, bool); - STL2_EXACT_TYPE_CONSTRAINT(b1 || b2, bool); - STL2_EXACT_TYPE_CONSTRAINT(a || b2, bool); - - // Requirements of Boolean that are not required by - // BooleanTestable. - STL2_BINARY_DEDUCTION_CONSTRAINT(b1 == b2, ConvertibleTo, bool); - STL2_BINARY_DEDUCTION_CONSTRAINT(b1 == a, ConvertibleTo, bool); - STL2_BINARY_DEDUCTION_CONSTRAINT(a == b2, ConvertibleTo, bool); - STL2_BINARY_DEDUCTION_CONSTRAINT(b1 != b2, ConvertibleTo, bool); - STL2_BINARY_DEDUCTION_CONSTRAINT(b1 != a, ConvertibleTo, bool); - STL2_BINARY_DEDUCTION_CONSTRAINT(a != b2, ConvertibleTo, bool); - } - constexpr bool __boolean = true; - template concept bool Boolean() { - return MoveConstructible() && __boolean; + return Movable>() && + requires(const remove_reference_t& b1, + const remove_reference_t& b2, const bool a) { + // Requirements common to both Boolean and BooleanTestable. + { b1 } -> ConvertibleTo&&; + { !b1 } -> ConvertibleTo&&; + { b1 && a } -> Same&&; + { b1 || a } -> Same&&; + + // Requirements of Boolean that are also be valid for + // BooleanTestable, but for which BooleanTestable does not + // require validation. + { b1 && b2 } -> Same&&; + { a && b2 } -> Same&&; + { b1 || b2 } -> Same&&; + { a || b2 } -> Same&&; + + // Requirements of Boolean that are not required by + // BooleanTestable. + { b1 == b2 } -> ConvertibleTo&&; + { b1 == a } -> ConvertibleTo&&; + { a == b2 } -> ConvertibleTo&&; + { b1 != b2 } -> ConvertibleTo&&; + { b1 != a } -> ConvertibleTo&&; + { a != b2 } -> ConvertibleTo&&; + }; } namespace models { @@ -67,18 +64,6 @@ STL2_OPEN_NAMESPACE { constexpr bool Boolean = true; } - template - constexpr bool __equality_comparable = false; - template - requires - requires(const T& t, const U& u) { - STL2_DEDUCTION_CONSTRAINT(t == u, Boolean); - STL2_DEDUCTION_CONSTRAINT(t != u, Boolean); - // Axiom: t == u and t != u have the same definition space - // Axiom: bool(t != u) == !bool(t == u) - } - constexpr bool __equality_comparable = true; - /////////////////////////////////////////////////////////////////////////// // WeaklyEqualityComparable [concepts.lib.compare.equalitycomparable] // Relaxation of EqualityComparable that doesn't require @@ -88,10 +73,15 @@ STL2_OPEN_NAMESPACE { // template concept bool WeaklyEqualityComparable() { - return __equality_comparable && - __equality_comparable; - // Axiom: u == t and t == u have the same definition space - // Axiom: bool(u == t) == bool(t == u) + return requires(const remove_reference_t& t, + const remove_reference_t& u) { + { t == u } -> Boolean&&; + { t != u } -> Boolean&&; + { u == t } -> Boolean&&; + { u != t } -> Boolean&&; + // Axiom: t == u and t != u have the same definition space + // Axiom: bool(t != u) == !bool(t == u) + }; } namespace models { @@ -115,8 +105,13 @@ STL2_OPEN_NAMESPACE { EqualityComparable() && EqualityComparable() && WeaklyEqualityComparable() && - CommonReference() && - EqualityComparable<__uncvref>>(); + CommonReference< + const remove_reference_t&, + const remove_reference_t&>() && + EqualityComparable< + common_reference_t< + const remove_reference_t&, + const remove_reference_t&>>(); } namespace models { @@ -132,20 +127,19 @@ STL2_OPEN_NAMESPACE { // StrictTotallyOrdered [concepts.lib.compare.stricttotallyordered] // template - constexpr bool __totally_ordered = false; - template - requires requires(const T& t, const U& u) { - STL2_DEDUCTION_CONSTRAINT(t < u, Boolean); - STL2_DEDUCTION_CONSTRAINT(t > u, Boolean); - STL2_DEDUCTION_CONSTRAINT(t <= u, Boolean); - STL2_DEDUCTION_CONSTRAINT(t >= u, Boolean); + concept bool __totally_ordered = + requires(const remove_reference_t& t, + const remove_reference_t& u) { + { t < u } -> Boolean&&; + { t > u } -> Boolean&&; + { t <= u } -> Boolean&&; + { t >= u } -> Boolean&&; // Axiom: t < u, t > u, t <= u, t >= u have the same definition space. // Axiom: If bool(t < u) then bool(t <= u) // Axiom: If bool(t > u) then bool(t >= u) // Axiom: Exactly one of bool(t < u), bool(t > u), or // (bool(t <= u) && bool(t >= u)) is true - } - constexpr bool __totally_ordered = true; + }; template concept bool StrictTotallyOrdered() { @@ -160,8 +154,13 @@ STL2_OPEN_NAMESPACE { EqualityComparable() && __totally_ordered && __totally_ordered && - CommonReference() && - StrictTotallyOrdered<__uncvref>>(); + CommonReference< + const remove_reference_t&, + const remove_reference_t&>() && + StrictTotallyOrdered< + common_reference_t< + const remove_reference_t&, + const remove_reference_t&>>(); } namespace models { diff --git a/include/stl2/detail/concepts/object.hpp b/include/stl2/detail/concepts/object.hpp index 920e87be4..338b08ae4 100644 --- a/include/stl2/detail/concepts/object.hpp +++ b/include/stl2/detail/concepts/object.hpp @@ -49,7 +49,7 @@ STL2_OPEN_NAMESPACE { // the decayed type can in fact be constructed from the actual type. // template - requires models::Constructible, T> + requires Constructible, T>() using __f = decay_t; diff --git a/include/stl2/detail/concepts/object/assignable.hpp b/include/stl2/detail/concepts/object/assignable.hpp index ec74019a5..1a749d84a 100644 --- a/include/stl2/detail/concepts/object/assignable.hpp +++ b/include/stl2/detail/concepts/object/assignable.hpp @@ -24,20 +24,13 @@ STL2_OPEN_NAMESPACE { // // Not to spec // See https://github.com/ericniebler/stl2/issues/229 - template - constexpr bool __assignable = false; - template - requires - requires(T& t, U&& u) { - STL2_EXACT_TYPE_CONSTRAINT(t = (U&&)u, T&); - } - constexpr bool __assignable = true; - template concept bool Assignable() { return _Is && CommonReference() && - __assignable; + requires(T t, U&& u) { + { t = (U&&)u } -> Same&&; + }; } namespace models { diff --git a/include/stl2/detail/concepts/object/move_constructible.hpp b/include/stl2/detail/concepts/object/move_constructible.hpp index c7a9e586b..78f9d71f3 100644 --- a/include/stl2/detail/concepts/object/move_constructible.hpp +++ b/include/stl2/detail/concepts/object/move_constructible.hpp @@ -22,15 +22,13 @@ STL2_OPEN_NAMESPACE { /////////////////////////////////////////////////////////////////////////// // Addressable [Extension] // - template - constexpr bool __addressable = false; template - requires requires(T& t, const remove_reference_t& ct) { - STL2_EXACT_TYPE_CONSTRAINT(&t, remove_reference_t*); - STL2_EXACT_TYPE_CONSTRAINT(&ct, const remove_reference_t*); + concept bool __addressable = + requires(T& t, const remove_reference_t& ct) { + { &t } -> Same*>&&; + { &ct } -> Same*>&&; // Axiom: &ct == addressof(ct) - } - constexpr bool __addressable = true; + }; namespace ext { template diff --git a/include/stl2/detail/concepts/urng.hpp b/include/stl2/detail/concepts/urng.hpp index 5a0bcde8f..5c7bbb29b 100644 --- a/include/stl2/detail/concepts/urng.hpp +++ b/include/stl2/detail/concepts/urng.hpp @@ -23,8 +23,8 @@ STL2_OPEN_NAMESPACE { requires(G&& g) { g(); requires UnsignedIntegral(); - STL2_EXACT_TYPE_CONSTRAINT(G::min(), decltype(g())); - STL2_EXACT_TYPE_CONSTRAINT(G::max(), decltype(g())); + { G::min() } -> Same&&; + { G::max() } -> Same&&; }; namespace models { diff --git a/include/stl2/detail/ebo_box.hpp b/include/stl2/detail/ebo_box.hpp index ee5902643..ca62086bd 100644 --- a/include/stl2/detail/ebo_box.hpp +++ b/include/stl2/detail/ebo_box.hpp @@ -30,25 +30,25 @@ STL2_OPEN_NAMESPACE { ebo_box() = default; constexpr ebo_box(const T& t) noexcept(std::is_nothrow_copy_constructible::value) - requires models::CopyConstructible + requires CopyConstructible() : item_(t) {} constexpr ebo_box(T&& t) noexcept(std::is_nothrow_move_constructible::value) - requires models::MoveConstructible + requires MoveConstructible() : item_(std::move(t)) {} template requires - !models::_OneOf, ebo_box, T> && - models::Constructible && - models::ConvertibleTo + !_OneOf, ebo_box, T> && + Constructible() && + ConvertibleTo() constexpr ebo_box(First&& f) noexcept(std::is_nothrow_constructible::value) : item_(std::forward(f)) {} template requires - (sizeof...(Rest) > 0 || !models::_OneOf, ebo_box, T>) && - models::Constructible + (sizeof...(Rest) > 0 || !_OneOf, ebo_box, T>) && + Constructible() constexpr explicit ebo_box(First&& f, Rest&&...r) noexcept(std::is_nothrow_constructible::value) : item_(std::forward(f), std::forward(r)...) {} @@ -75,7 +75,7 @@ STL2_OPEN_NAMESPACE { noexcept(std::is_nothrow_move_constructible::value) requires MoveConstructible() : T(std::move(t)) {} -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires !models::_OneOf, ebo_box, T> && diff --git a/include/stl2/detail/functional/comparisons.hpp b/include/stl2/detail/functional/comparisons.hpp index bff2eec9b..7b4094301 100644 --- a/include/stl2/detail/functional/comparisons.hpp +++ b/include/stl2/detail/functional/comparisons.hpp @@ -23,10 +23,9 @@ STL2_OPEN_NAMESPACE { /////////////////////////////////////////////////////////////////////////// // equal_to [comparisons] // - template struct equal_to; - - EqualityComparable{T} - struct equal_to { + template + requires EqualityComparable() || Same() + struct equal_to { constexpr bool operator()(const T& a, const T& b) const { return a == b; } @@ -35,8 +34,8 @@ STL2_OPEN_NAMESPACE { template <> struct equal_to { EqualityComparable{T, U} - constexpr decltype(auto) operator()(const T& t, const U& u) const { - return t == u; + constexpr decltype(auto) operator()(T&& t, U&& u) const { + return std::forward(t) == std::forward(u); } using is_transparent = true_type; @@ -45,10 +44,9 @@ STL2_OPEN_NAMESPACE { /////////////////////////////////////////////////////////////////////////// // not_equal_to // - template struct not_equal_to; - - EqualityComparable{T} - struct not_equal_to { + template + requires EqualityComparable() || Same() + struct not_equal_to { constexpr bool operator()(const T& a, const T& b) const { return a != b; } @@ -57,8 +55,8 @@ STL2_OPEN_NAMESPACE { template <> struct not_equal_to { EqualityComparable{T, U} - constexpr decltype(auto) operator()(const T& t, const U& u) const { - return t != u; + constexpr decltype(auto) operator()(T&& t, U&& u) const { + return std::forward(t) != std::forward(u); } using is_transparent = true_type; @@ -67,20 +65,19 @@ STL2_OPEN_NAMESPACE { /////////////////////////////////////////////////////////////////////////// // greater // - template struct greater; - - StrictTotallyOrdered{T} - struct greater { + template + requires StrictTotallyOrdered() || Same() + struct greater { constexpr bool operator()(const T& a, const T& b) const { return a > b; } }; template <> - struct greater : private std::greater { + struct greater { StrictTotallyOrdered{T, U} - constexpr decltype(auto) operator()(const T& t, const U& u) const { - return std::greater::operator()(t, u); + constexpr decltype(auto) operator()(T&& t, U&& u) const { + return std::forward(t) > std::forward(u); } using is_transparent = true_type; @@ -94,20 +91,19 @@ STL2_OPEN_NAMESPACE { /////////////////////////////////////////////////////////////////////////// // less // - template struct less; - - StrictTotallyOrdered{T} - struct less { + template + requires StrictTotallyOrdered() || Same() + struct less { constexpr bool operator()(const T& a, const T& b) const { return a < b; } }; template <> - struct less : private std::less { + struct less { StrictTotallyOrdered{T, U} - constexpr decltype(auto) operator()(const T& t, const U& u) const { - return std::less::operator()(t, u); + constexpr decltype(auto) operator()(T&& t, U&& u) const { + return std::forward(t) < std::forward(u); } using is_transparent = true_type; @@ -121,20 +117,19 @@ STL2_OPEN_NAMESPACE { /////////////////////////////////////////////////////////////////////////// // greater_equal // - template struct greater_equal; - - StrictTotallyOrdered{T} - struct greater_equal { + template + requires StrictTotallyOrdered() || Same() + struct greater_equal { constexpr bool operator()(const T& a, const T& b) const { return a >= b; } }; template <> - struct greater_equal : private std::greater_equal { + struct greater_equal { StrictTotallyOrdered{T, U} - constexpr decltype(auto) operator()(const T& t, const U& u) const { - return std::greater_equal::operator()(t, u); + constexpr decltype(auto) operator()(T&& t, U&& u) const { + return std::forward(t) >= std::forward(u); } using is_transparent = true_type; @@ -148,20 +143,19 @@ STL2_OPEN_NAMESPACE { /////////////////////////////////////////////////////////////////////////// // less_equal // - template struct less_equal; - - StrictTotallyOrdered{T} - struct less_equal { + template + requires StrictTotallyOrdered() || Same() + struct less_equal { constexpr bool operator()(const T& a, const T& b) const { return a <= b; } }; template <> - struct less_equal : private std::less_equal { + struct less_equal { StrictTotallyOrdered{T, U} - constexpr decltype(auto) operator()(const T& t, const U& u) const { - return std::less_equal::operator()(t, u); + constexpr decltype(auto) operator()(T&& t, U&& u) const { + return std::forward(t) <= std::forward(u); } using is_transparent = true_type; diff --git a/include/stl2/detail/fwd.hpp b/include/stl2/detail/fwd.hpp index e1caee771..1594c3dae 100644 --- a/include/stl2/detail/fwd.hpp +++ b/include/stl2/detail/fwd.hpp @@ -75,65 +75,6 @@ STL2_OPEN_NAMESPACE { // Used to qualify STL2 names namespace __stl2 = ::std::experimental::ranges; -// Workaround bugs in deduction constraints by replacing: -// * { E } -> T with requires T() -// * { E } -> Same with requires Same() -// * { E } -> ConvertibleTo with requires ConvertibleTo() -#if 0 -#define STL2_DEDUCTION_CONSTRAINT(E, ...) \ - { E } -> __VA_ARGS__ - -#define STL2_BINARY_DEDUCTION_CONSTRAINT(E, C, ...) \ - STL2_DEDUCTION_CONSTRAINT(E, C<__VA_ARGS__>) - -#else -#define STL2_DEDUCTION_CONSTRAINT(E, ...) \ - E; requires __VA_ARGS__ () - -#define STL2_BINARY_DEDUCTION_CONSTRAINT(E, C, ...) \ - E; requires C() -#endif - -#define STL2_EXACT_TYPE_CONSTRAINT(E, ...) \ - STL2_BINARY_DEDUCTION_CONSTRAINT(E, Same, __VA_ARGS__) - -#define STL2_CONVERSION_CONSTRAINT(E, ...) \ - STL2_BINARY_DEDUCTION_CONSTRAINT(E, ConvertibleTo, __VA_ARGS__) - -// Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67384 -// Use the expression constraint "deduce_auto_ref_ref(E);" in place -// of the compound constraint "{ E } -> auto&&;" -STL2_OPEN_NAMESPACE { - namespace detail { - void deduce_auto_ref(auto&); // undefined - void deduce_auto_ref_ref(auto&&); // undefined - } -} STL2_CLOSE_NAMESPACE - -#define STL2_DEDUCE_AUTO_REF(E) \ - ::__stl2::detail::deduce_auto_ref(E) - -#define STL2_DEDUCE_AUTO_REF_REF(E) \ - ::__stl2::detail::deduce_auto_ref_ref(E) - -// Workaround bugs in constrained return types -// (e.g., Iterator begin(Range&&);) by simply disabling -// the feature and using "auto" -#if 1 -#define STL2_CONSTRAINED_RETURN(...) __VA_ARGS__ -#else -#define STL2_CONSTRAINED_RETURN(...) auto -#endif - -// Workaround bugs in constrained variable definitions -// (e.g., Iterator x = begin(r);) by simply disabling -// the feature and using "auto" -#if 1 -#define STL2_CONSTRAINED_VAR(...) __VA_ARGS__ -#else -#define STL2_CONSTRAINED_VAR(...) auto -#endif - #define STL2_NOEXCEPT_RETURN(...) \ noexcept(noexcept(__VA_ARGS__)) \ { return __VA_ARGS__; } diff --git a/include/stl2/detail/iostream/concepts.hpp b/include/stl2/detail/iostream/concepts.hpp index eaa27d0fe..7d99fa131 100644 --- a/include/stl2/detail/iostream/concepts.hpp +++ b/include/stl2/detail/iostream/concepts.hpp @@ -20,18 +20,12 @@ STL2_OPEN_NAMESPACE { // StreamExtractable [Extension] // namespace ext { - template - constexpr bool __stream_extractable = false; - template - requires + template + concept bool StreamExtractable = requires(Stream& is, T& t) { - STL2_EXACT_TYPE_CONSTRAINT(is >> t, Stream&); + { is >> t } -> Same&&; // Axiom: &is == &(is << t) - } - constexpr bool __stream_extractable = true; - - template - concept bool StreamExtractable = __stream_extractable; + }; } namespace models { @@ -45,18 +39,12 @@ STL2_OPEN_NAMESPACE { // StreamInsertable [Extension] // namespace ext { - template - constexpr bool __stream_insertable = false; - template - requires + template + concept bool StreamInsertable = requires(Stream& os, const T& t) { - STL2_EXACT_TYPE_CONSTRAINT(os << t, Stream&); + { os << t } -> Same&&; // Axiom: &os == &(os << t) - } - constexpr bool __stream_insertable = true; - - template - concept bool StreamInsertable = __stream_insertable; + }; } namespace models { diff --git a/include/stl2/detail/iterator/basic_iterator.hpp b/include/stl2/detail/iterator/basic_iterator.hpp index 99c9d24f3..964d318a2 100644 --- a/include/stl2/detail/iterator/basic_iterator.hpp +++ b/include/stl2/detail/iterator/basic_iterator.hpp @@ -120,7 +120,7 @@ STL2_OPEN_NAMESPACE { template struct reference_type {}; template requires - requires(const C& c) { STL2_DEDUCE_AUTO_REF_REF(c.read()); } + requires(const C& c) { { c.read() } -> auto&&; } struct reference_type { using type = decltype(declval().read()); }; @@ -150,7 +150,7 @@ STL2_OPEN_NAMESPACE { template struct _MixinTestWrapper : protected M { decltype(auto) g() & { return (*this).get(); } - decltype(auto) g() const& { return (*this).getz(); } + decltype(auto) g() const& { return (*this).get(); } decltype(auto) g() && { return std::move(*this).get(); } decltype(auto) g() const&& { return std::move(*this).get(); } }; @@ -184,7 +184,7 @@ STL2_OPEN_NAMESPACE { template concept bool Readable() { return Cursor() && requires(const C& c) { - STL2_DEDUCE_AUTO_REF_REF(c.read()); + { c.read() } -> auto&&; typename reference_t; typename value_type_t; }; @@ -192,7 +192,7 @@ STL2_OPEN_NAMESPACE { template concept bool Arrow() { return Readable() && requires(const C& c) { - STL2_DEDUCE_AUTO_REF_REF(c.arrow()); + { c.arrow() } -> auto&&; }; } template @@ -212,8 +212,7 @@ STL2_OPEN_NAMESPACE { template concept bool SizedSentinel() { return Sentinel() && requires(const C& c, const S& s) { - // Equivalent to: { c.distance_to(s) } -> Same; - STL2_EXACT_TYPE_CONSTRAINT(c.distance_to(s), difference_type_t); + { c.distance_to(s) } -> Same>&&; }; } @@ -241,7 +240,7 @@ STL2_OPEN_NAMESPACE { template concept bool IndirectMove() { return Readable() && requires(const C& c) { - STL2_DEDUCE_AUTO_REF_REF(c.indirect_move()); + { c.indirect_move() } -> auto&&; }; } @@ -520,7 +519,7 @@ STL2_OPEN_NAMESPACE { template concept bool PostIncrementCursor() { return requires(C& c) { - STL2_EXACT_TYPE_CONSTRAINT(c.post_increment(), C); + { c.post_increment() } -> Same&&; }; } } // namespace detail @@ -621,7 +620,7 @@ STL2_OPEN_NAMESPACE { constexpr explicit basic_iterator(C&& c) noexcept(std::is_nothrow_constructible::value) : mixin(std::move(c)) {} -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires !models::_OneOf, basic_iterator, mixin, C> && @@ -670,8 +669,8 @@ STL2_OPEN_NAMESPACE { // http://wg21.link/P0186 template requires - !models::Same, basic_iterator> && - models::Assignable + !Same, basic_iterator>() && + Assignable() constexpr basic_iterator& operator=(O&& o) & noexcept(is_nothrow_assignable::value) { @@ -718,6 +717,8 @@ STL2_OPEN_NAMESPACE { requires !cursor::Arrow() && cursor::Readable() && std::is_lvalue_reference::value && + // BUGBUG causes a strange failure. Tested with gcc trunk Feb 17 2017: + //Same, __uncvref>() models::Same, __uncvref> { return __stl2::addressof(**this); diff --git a/include/stl2/detail/iterator/common_iterator.hpp b/include/stl2/detail/iterator/common_iterator.hpp index 4a7cddb4e..c7b46c803 100644 --- a/include/stl2/detail/iterator/common_iterator.hpp +++ b/include/stl2/detail/iterator/common_iterator.hpp @@ -40,7 +40,7 @@ STL2_OPEN_NAMESPACE { template constexpr explicit operator_arrow_proxy(U&& u) noexcept(std::is_nothrow_constructible::value) - requires models::Constructible + requires Constructible() : value_(std::forward(u)) {} constexpr const T* operator->() const noexcept { @@ -50,7 +50,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Readable && + Readable() && (std::is_pointer::value || requires(const I& i) { i.operator->(); }) constexpr I operator_arrow_(const I& i, ext::priority_tag<2>) @@ -60,7 +60,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Readable && + Readable() && _Is, std::is_reference> constexpr auto operator_arrow_(const I& i, ext::priority_tag<1>) noexcept(noexcept(*i)) { @@ -70,9 +70,9 @@ STL2_OPEN_NAMESPACE { template requires - models::Readable && + Readable() && !std::is_reference>::value && - models::Constructible, reference_t> + Constructible, reference_t>() constexpr auto operator_arrow_(const I& i, ext::priority_tag<0>) noexcept( std::is_nothrow_move_constructible< @@ -84,7 +84,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Readable && + Readable() && requires(const I& i) { __common_iterator::operator_arrow_(i, ext::max_priority_tag); } diff --git a/include/stl2/detail/iterator/concepts.hpp b/include/stl2/detail/iterator/concepts.hpp index 02fe580ef..c7774b3ee 100644 --- a/include/stl2/detail/iterator/concepts.hpp +++ b/include/stl2/detail/iterator/concepts.hpp @@ -32,16 +32,10 @@ STL2_OPEN_NAMESPACE { namespace detail { template - constexpr bool __dereferenceable = false; - template - requires + concept bool Dereferenceable = requires(T& t) { - STL2_DEDUCE_AUTO_REF_REF(*t); - } - constexpr bool __dereferenceable = true; - - template - concept bool Dereferenceable = __dereferenceable; + { *t } -> auto&&; + }; } namespace models { @@ -71,9 +65,9 @@ STL2_OPEN_NAMESPACE { constexpr bool has_customization = false; template requires - models::Dereferenceable && + detail::Dereferenceable && requires(R&& r) { - STL2_DEDUCE_AUTO_REF_REF(iter_move((R&&)r)); + { iter_move((R&&)r) } -> auto&&; } constexpr bool has_customization = true; @@ -84,7 +78,7 @@ STL2_OPEN_NAMESPACE { struct fn { template requires - models::Dereferenceable && has_customization + detail::Dereferenceable && has_customization constexpr decltype(auto) operator()(R&& r) const STL2_NOEXCEPT_RETURN( iter_move((R&&)r) @@ -92,7 +86,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Dereferenceable + detail::Dereferenceable constexpr rvalue> operator()(R&& r) const STL2_NOEXCEPT_RETURN( static_cast>>(*r) @@ -161,32 +155,22 @@ STL2_OPEN_NAMESPACE { // Not to spec: Disables the "Experimental additional tests" // See https://github.com/ericniebler/stl2/issues/239 // - template - constexpr bool __readable = false; - template - requires requires(const I& i) { - // Associated types - typename value_type_t; - typename reference_t; - typename rvalue_reference_t; - // Valid expressions - STL2_EXACT_TYPE_CONSTRAINT(*i, reference_t); - STL2_EXACT_TYPE_CONSTRAINT(__stl2::iter_move(i), rvalue_reference_t); - } - // Relationships between associated types - && models::CommonReference, value_type_t&> - && models::CommonReference, rvalue_reference_t> - && models::CommonReference, const value_type_t&> -#if 0 - // Experimental additional tests - && models::Same, value_t>, value_t> - && models::Same, value_t>, value_t> -#endif - constexpr bool __readable = true; - template concept bool Readable() { - return Movable() && DefaultConstructible() && __readable; + return Movable() && DefaultConstructible() && + requires(const I& i) { + // Associated types + typename value_type_t; + typename reference_t; + typename rvalue_reference_t; + // Valid expressions + { *i } -> auto&&; + { __stl2::iter_move(i) } -> auto&&; + } && + // Relationships between associated types + CommonReference, value_type_t&>() && + CommonReference, rvalue_reference_t>() && + CommonReference, const value_type_t&>(); } namespace models { @@ -339,7 +323,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Swappable, reference_t> + Swappable, reference_t>() constexpr void impl(R1&& r1, R2&& r2) STL2_NOEXCEPT_RETURN( __stl2::swap(*r1, *r2) @@ -347,9 +331,9 @@ STL2_OPEN_NAMESPACE { template requires - !models::Swappable, reference_t> && - models::IndirectlyMovableStorable && - models::IndirectlyMovableStorable + !Swappable, reference_t>() && + IndirectlyMovableStorable() && + IndirectlyMovableStorable() constexpr void impl(R1& r1, R2& r2) noexcept( is_nothrow_indirectly_movable_storable_v && @@ -363,8 +347,8 @@ STL2_OPEN_NAMESPACE { struct fn { template requires - models::Readable> && - models::Readable> && + Readable>() && + Readable>() && has_customization constexpr void operator()(R1&& r1, R2&& r2) const STL2_NOEXCEPT_RETURN( @@ -373,8 +357,8 @@ STL2_OPEN_NAMESPACE { template requires - models::Readable> && - models::Readable> && + Readable>() && + Readable>() && !has_customization && requires(R1& r1, R2& r2) { __iter_swap::impl(r1, r2); @@ -395,25 +379,24 @@ STL2_OPEN_NAMESPACE { // Not to spec // See https://github.com/ericniebler/stl2/issues/241 // + + template + concept bool IndirectlySwappable() { + return requires(I1&& i1, I2&& i2) { + __stl2::iter_swap((I1&&)i1, (I2&&)i2); + __stl2::iter_swap((I2&&)i2, (I1&&)i1); + __stl2::iter_swap((I1&&)i1, (I1&&)i1); + __stl2::iter_swap((I2&&)i2, (I2&&)i2); + }; + } + namespace models { template constexpr bool IndirectlySwappable = false; - template - requires - requires(I1&& i1, I2&& i2) { - __stl2::iter_swap((I1&&)i1, (I2&&)i2); - __stl2::iter_swap((I2&&)i2, (I1&&)i1); - __stl2::iter_swap((I1&&)i1, (I1&&)i1); - __stl2::iter_swap((I2&&)i2, (I2&&)i2); - } + __stl2::IndirectlySwappable{I1, I2} constexpr bool IndirectlySwappable = true; } - template - concept bool IndirectlySwappable() { - return models::IndirectlySwappable; - } - template constexpr bool is_nothrow_indirectly_swappable_v = false; @@ -503,7 +486,7 @@ STL2_OPEN_NAMESPACE { // template concept bool Iterator() { - return WeaklyIncrementable() && detail::Dereferenceable; + return detail::Dereferenceable && WeaklyIncrementable(); // Axiom?: i is non-singular iff it denotes an element // Axiom?: if i equals j then i and j denote equal elements // Axiom?: I{} is in the domain of copy/move construction/assignment @@ -526,7 +509,9 @@ STL2_OPEN_NAMESPACE { // template concept bool Sentinel() { - return Iterator() && Semiregular() && WeaklyEqualityComparable(); + return Iterator() && + Semiregular() && + WeaklyEqualityComparable(); // Axiom: if [i,s) denotes a range then: // * i == s is well-defined // * if bool(i == s) then [i,s) is empty @@ -553,27 +538,21 @@ STL2_OPEN_NAMESPACE { template constexpr bool disable_sized_sentinel = false; - template - constexpr bool __sized_sentinel = false; - template - requires requires(const I i, const S s) { - STL2_EXACT_TYPE_CONSTRAINT(s - i, difference_type_t); - STL2_EXACT_TYPE_CONSTRAINT(i - s, difference_type_t); - // Axiom: If [i,s) denotes a range and N is the smallest - // non-negative integer such that N applications of - // ++i make bool(i == s) == true - // * if N is representable by difference_type_t then - // s - i is well-defined and equal to N - // * if -N is representable by difference_type_t then - // i - s is well-defined and equal to -N - } - constexpr bool __sized_sentinel = true; - template concept bool SizedSentinel() { return Sentinel() && !disable_sized_sentinel, remove_cv_t> && - __sized_sentinel; + requires(const I i, const S s) { + { s - i } -> Same>&&; + { i - s } -> Same>&&; + // Axiom: If [i,s) denotes a range and N is the smallest + // non-negative integer such that N applications of + // ++i make bool(i == s) == true + // * if N is representable by difference_type_t then + // s - i is well-defined and equal to N + // * if -N is representable by difference_type_t then + // i - s is well-defined and equal to -N + }; } namespace models { @@ -590,7 +569,7 @@ STL2_OPEN_NAMESPACE { template concept bool OutputIterator() { return Iterator() && Writable() && - requires(I i, T&& t) { + requires(I& i, T&& t) { *i++ = std::forward(t); }; } @@ -607,20 +586,15 @@ STL2_OPEN_NAMESPACE { // Not to spec: No requirements on i++ // See http://github.com/ericniebler/stl2/issues/232 // - template - constexpr bool __input_iterator = false; - template - requires requires(I& i, const I& ci) { - typename iterator_category_t; - DerivedFrom, input_iterator_tag>(); - i++; - { *ci } -> const value_type_t&; - } - constexpr bool __input_iterator = true; - template concept bool InputIterator() { - return Iterator() && Readable() && __input_iterator; + return Iterator() && + Readable() && + requires(I& i, const I& ci) { + typename iterator_category_t; + DerivedFrom, input_iterator_tag>(); + i++; + }; } namespace models { @@ -675,14 +649,6 @@ STL2_OPEN_NAMESPACE { /////////////////////////////////////////////////////////////////////////// // RandomAccessIterator [iterators.random.access] // - template - constexpr bool __random_access_iterator = false; - template - requires requires(const I& ci, const difference_type_t n) { - STL2_EXACT_TYPE_CONSTRAINT(ci[n], reference_t); - } - constexpr bool __random_access_iterator = true; - template concept bool RandomAccessIterator() { return BidirectionalIterator() && @@ -691,7 +657,10 @@ STL2_OPEN_NAMESPACE { // Should ordering be in SizedSentinel and/or RandomAccessIncrementable? StrictTotallyOrdered() && ext::RandomAccessIncrementable() && - __random_access_iterator; + requires(const I& ci, const difference_type_t n) { + ci[n]; + requires Same>(); + }; // FIXME: Axioms for definition space of ordering operations. Don't // require them to be the same space as ==, since pointers can't meet // that requirement. Formulation should be similar to that for == in @@ -737,7 +706,7 @@ STL2_OPEN_NAMESPACE { template requires requires(I i) { - STL2_DEDUCE_AUTO_REF_REF(i.operator->()); + { i.operator->() } -> auto&&; } struct __pointer_type { using type = decltype(declval().operator->()); diff --git a/include/stl2/detail/iterator/increment.hpp b/include/stl2/detail/iterator/increment.hpp index 6b930a957..f332e7946 100644 --- a/include/stl2/detail/iterator/increment.hpp +++ b/include/stl2/detail/iterator/increment.hpp @@ -46,7 +46,7 @@ STL2_OPEN_NAMESPACE { struct difference_type : difference_type> {}; - template + detail::MemberDifferenceType{T} struct difference_type { using type = typename T::difference_type; }; @@ -55,7 +55,10 @@ STL2_OPEN_NAMESPACE { requires !detail::MemberDifferenceType && _IsNot && // Avoid GCC PR 78173 (See above) requires(const T& a, const T& b) { - STL2_DEDUCTION_CONSTRAINT(a - b, Integral); + // Avoid gcc ICE (TODO file bug): + a - b; + requires Integral(); + // { a - b } -> Integral; } struct difference_type : make_signed() - declval())> {}; @@ -66,20 +69,14 @@ STL2_OPEN_NAMESPACE { /////////////////////////////////////////////////////////////////////////// // WeaklyIncrementable [weaklyincrementable.iterators] // - template - constexpr bool __weakly_incrementable = false; - template - requires requires(I& i) { - typename difference_type_t; - STL2_EXACT_TYPE_CONSTRAINT(++i, I&); - i++; - } - constexpr bool __weakly_incrementable = true; - template concept bool WeaklyIncrementable() { return Semiregular() && - __weakly_incrementable; + requires(I& i) { + typename difference_type_t; + { ++i } -> Same&&; + i++; + }; } namespace models { @@ -92,19 +89,13 @@ STL2_OPEN_NAMESPACE { /////////////////////////////////////////////////////////////////////////// // Incrementable [incrementable.iterators] // - template - constexpr bool __incrementable = false; - template - requires requires(I& i) { - STL2_EXACT_TYPE_CONSTRAINT(i++, I); - } - constexpr bool __incrementable = true; - template concept bool Incrementable() { return WeaklyIncrementable() && EqualityComparable() && - __incrementable; + requires(I& i) { + { i++ } -> Same&&; + }; } namespace models { @@ -118,18 +109,13 @@ STL2_OPEN_NAMESPACE { // Decrementable [Extension] // namespace ext { - template - constexpr bool __decrementable = false; - template - requires requires(I& i) { - STL2_EXACT_TYPE_CONSTRAINT(--i, I&); - STL2_EXACT_TYPE_CONSTRAINT(i--, I); - } - constexpr bool __decrementable = true; - template concept bool Decrementable() { - return Incrementable() && __decrementable; + return Incrementable() && + requires(I& i) { + { --i } -> Same&&; + { i-- } -> Same&&; + }; // Let a and b be objects of type I. // Axiom: &--a == &a // Axiom: bool(a == b) implies bool(a-- == b) @@ -150,23 +136,17 @@ STL2_OPEN_NAMESPACE { // RandomAccessIncrementable [Extension] // namespace ext { - template - constexpr bool __random_access_incrementable = false; - template - requires requires(I& i, const I& ci, const difference_type_t n) { - STL2_EXACT_TYPE_CONSTRAINT(i += n, I&); - STL2_EXACT_TYPE_CONSTRAINT(i -= n, I&); - STL2_EXACT_TYPE_CONSTRAINT(ci + n, I); - STL2_EXACT_TYPE_CONSTRAINT(n + ci, I); - STL2_EXACT_TYPE_CONSTRAINT(ci - n, I); - { ci - ci } -> difference_type_t; - } - constexpr bool __random_access_incrementable = true; - template concept bool RandomAccessIncrementable() { return Decrementable() && - __random_access_incrementable; + requires(I& i, const I& ci, const difference_type_t n) { + { i += n } -> Same&&; + { i -= n } -> Same&&; + { ci + n } -> Same&&; + { n + ci } -> Same&&; + { ci - n } -> Same&&; + { ci - ci } -> difference_type_t; + }; // FIXME: Axioms } } diff --git a/include/stl2/detail/iterator/istream_iterator.hpp b/include/stl2/detail/iterator/istream_iterator.hpp index 351b016e6..f5ab2868a 100644 --- a/include/stl2/detail/iterator/istream_iterator.hpp +++ b/include/stl2/detail/iterator/istream_iterator.hpp @@ -34,9 +34,9 @@ STL2_OPEN_NAMESPACE { class traits = std::char_traits, SignedIntegral Distance = std::ptrdiff_t> requires - models::DefaultConstructible && - models::CopyConstructible && - models::StreamExtractable> + DefaultConstructible() && + CopyConstructible() && + ext::StreamExtractable> class istream_cursor : semiregular_box { using box_t = semiregular_box; public: @@ -129,9 +129,9 @@ STL2_OPEN_NAMESPACE { template , SignedIntegral Distance = std::ptrdiff_t> requires - models::DefaultConstructible && - models::CopyConstructible && - models::StreamExtractable> + DefaultConstructible() && + CopyConstructible() && + ext::StreamExtractable> using istream_iterator = basic_iterator>; } STL2_CLOSE_NAMESPACE diff --git a/include/stl2/detail/iterator/move_iterator.hpp b/include/stl2/detail/iterator/move_iterator.hpp index f77228708..784f8fd5c 100644 --- a/include/stl2/detail/iterator/move_iterator.hpp +++ b/include/stl2/detail/iterator/move_iterator.hpp @@ -282,7 +282,7 @@ STL2_OPEN_NAMESPACE { // Not to spec: constexpr per P0579 template requires - models::Semiregular<__f> + Semiregular<__f>() constexpr auto make_move_sentinel(S&& s) STL2_NOEXCEPT_RETURN( move_sentinel<__f>(__stl2::forward(s)) diff --git a/include/stl2/detail/iterator/operations.hpp b/include/stl2/detail/iterator/operations.hpp index 194a1efbb..8a87cc1e4 100644 --- a/include/stl2/detail/iterator/operations.hpp +++ b/include/stl2/detail/iterator/operations.hpp @@ -24,7 +24,7 @@ STL2_OPEN_NAMESPACE { namespace __advance { template requires - models::Iterator + Iterator() // Pre: 0 <= n && [i,i+n) constexpr void impl(I& i, difference_type_t n) noexcept(noexcept(++std::declval())) @@ -69,7 +69,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sentinel + Sentinel() // Pre: [i,bound) constexpr void advance(I& i, S bound) noexcept(noexcept(++i != bound)) @@ -81,7 +81,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sentinel && models::Assignable + Sentinel() && Assignable() constexpr void advance(I& i, S bound) STL2_NOEXCEPT_RETURN( (void)(i = std::move(bound)) @@ -89,8 +89,8 @@ STL2_OPEN_NAMESPACE { template requires - models::Sentinel && !models::Assignable && - models::SizedSentinel + Sentinel() && !Assignable() && + SizedSentinel() // Pre: [i,bound) constexpr void advance(I& i, S bound) noexcept(noexcept(__stl2::advance(i, bound - i))) @@ -103,7 +103,7 @@ STL2_OPEN_NAMESPACE { namespace __advance { template requires - models::Sentinel + Sentinel() // Pre: 0 == n || (0 < n && [i,bound)) constexpr difference_type_t impl(I& i, difference_type_t n, const S& bound) @@ -120,7 +120,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sentinel + Sentinel() // Pre: 0 == n || (0 < n && [i,bound)) constexpr difference_type_t advance(I& i, difference_type_t n, S bound) @@ -130,7 +130,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sentinel && models::SizedSentinel + Sentinel() && SizedSentinel() // Pre: 0 <= n && [i,bound) constexpr difference_type_t advance(I& i, difference_type_t n, S bound) @@ -151,7 +151,7 @@ STL2_OPEN_NAMESPACE { template requires - models::BidirectionalIterator + BidirectionalIterator() // Pre: 0 == n || (0 < n ? [i,bound) : [bound,i)) constexpr difference_type_t advance(I& i, difference_type_t n, I bound) @@ -172,7 +172,7 @@ STL2_OPEN_NAMESPACE { template requires - models::BidirectionalIterator && models::SizedSentinel + BidirectionalIterator() && SizedSentinel() // Pre: 0 == n ? ([i,bound) || [bound,i)) : (0 < n ? [i,bound) : [bound,i)) constexpr difference_type_t advance(I& i, difference_type_t n, I bound) @@ -200,7 +200,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sentinel<__f, I> + Sentinel<__f, I>() constexpr I next(I x, S&& bound) STL2_NOEXCEPT_RETURN( __stl2::advance(x, std::forward(bound)), @@ -209,7 +209,7 @@ STL2_OPEN_NAMESPACE { template requires - models::Sentinel<__f, I> + Sentinel<__f, I>() constexpr I next(I x, difference_type_t n, S&& bound) STL2_NOEXCEPT_RETURN( __stl2::advance(x, n, std::forward(bound)), diff --git a/include/stl2/detail/iterator/ostream_iterator.hpp b/include/stl2/detail/iterator/ostream_iterator.hpp index 43fdaf619..be32af62b 100644 --- a/include/stl2/detail/iterator/ostream_iterator.hpp +++ b/include/stl2/detail/iterator/ostream_iterator.hpp @@ -34,8 +34,8 @@ STL2_OPEN_NAMESPACE { // template > requires - models::Same || - models::StreamInsertable> + Same() || + ext::StreamInsertable> class ostream_iterator { public: using difference_type = ptrdiff_t; diff --git a/include/stl2/detail/iterator/ostreambuf_iterator.hpp b/include/stl2/detail/iterator/ostreambuf_iterator.hpp index a82a179eb..9ae5ff798 100644 --- a/include/stl2/detail/iterator/ostreambuf_iterator.hpp +++ b/include/stl2/detail/iterator/ostreambuf_iterator.hpp @@ -78,7 +78,7 @@ STL2_OPEN_NAMESPACE { friend bool operator!=(ostreambuf_iterator a, default_sentinel b) noexcept { return !(a == b); } - friend bool operator==(default_sentinel a, ostreambuf_iterator b) noexcept { + friend bool operator==(default_sentinel, ostreambuf_iterator b) noexcept { return b.sbuf_ == nullptr; } friend bool operator!=(default_sentinel a, ostreambuf_iterator b) noexcept { diff --git a/include/stl2/detail/range/access.hpp b/include/stl2/detail/range/access.hpp index c8addcc53..1310492a6 100644 --- a/include/stl2/detail/range/access.hpp +++ b/include/stl2/detail/range/access.hpp @@ -55,7 +55,7 @@ STL2_OPEN_NAMESPACE { // Prefer member if it returns Iterator. template requires has_member - constexpr STL2_CONSTRAINED_RETURN(Iterator) + constexpr Iterator operator()(R& r) const STL2_NOEXCEPT_RETURN( r.begin() @@ -63,13 +63,13 @@ STL2_OPEN_NAMESPACE { // Use ADL if it returns Iterator. template requires !has_member && has_non_member - constexpr STL2_CONSTRAINED_RETURN(Iterator) + constexpr Iterator operator()(R& r) const STL2_NOEXCEPT_RETURN( begin(r) ) template <_IsNot R> - [[deprecated]] constexpr STL2_CONSTRAINED_RETURN(Iterator) + [[deprecated]] constexpr Iterator operator()(const R&& r) const noexcept(noexcept(declval()(r))) requires has_member || has_non_member @@ -416,7 +416,7 @@ STL2_OPEN_NAMESPACE { template requires requires(const R& r) { - STL2_CONVERSION_CONSTRAINT(r.empty(), bool); + { r.empty() } -> bool; } constexpr bool has_member = true; diff --git a/include/stl2/detail/range/concepts.hpp b/include/stl2/detail/range/concepts.hpp index 052d11854..b24d5b9bc 100644 --- a/include/stl2/detail/range/concepts.hpp +++ b/include/stl2/detail/range/concepts.hpp @@ -61,20 +61,14 @@ STL2_OPEN_NAMESPACE { template constexpr bool disable_sized_range = false; - template - constexpr bool __sized_range = false; - template - requires requires(const R& r) { - STL2_DEDUCTION_CONSTRAINT(__stl2::size(r), Integral); - STL2_CONVERSION_CONSTRAINT(__stl2::size(r), difference_type_t>); - } - constexpr bool __sized_range = true; - template concept bool SizedRange() { return Range() && !disable_sized_range<__uncvref> && - __sized_range>; + requires(const remove_reference_t& r) { + { __stl2::size(r) } -> Integral; + { __stl2::size(r) } -> difference_type_t>; + }; } namespace models { @@ -234,18 +228,12 @@ STL2_OPEN_NAMESPACE { } namespace ext { - template - constexpr bool __contiguous_range = false; - template - requires requires(R& r) { - STL2_EXACT_TYPE_CONSTRAINT(__stl2::data(r), add_pointer_t>>); - } - constexpr bool __contiguous_range = true; - template concept bool ContiguousRange() { return SizedRange() && ContiguousIterator>() && - __contiguous_range>; + requires(R& r) { + { __stl2::data(r) } -> Same>>>&&; + }; } } diff --git a/include/stl2/detail/swap.hpp b/include/stl2/detail/swap.hpp index 39b128919..70a9fb27d 100644 --- a/include/stl2/detail/swap.hpp +++ b/include/stl2/detail/swap.hpp @@ -27,7 +27,7 @@ STL2_OPEN_NAMESPACE { // See https://github.com/ericniebler/stl2/322 template requires - models::MoveConstructible && models::Assignable + MoveConstructible() && Assignable() constexpr T exchange(T& t, U&& u) noexcept(is_nothrow_move_constructible::value && is_nothrow_assignable::value) @@ -78,8 +78,8 @@ STL2_OPEN_NAMESPACE { ) template requires - !has_customization && models::MoveConstructible && - models::Assignable + !has_customization && MoveConstructible() && + Assignable() constexpr void operator()(T& a, T& b) const STL2_NOEXCEPT_RETURN( (void)(b = __stl2::exchange(a, __stl2::move(b))) diff --git a/include/stl2/detail/variant/fwd.hpp b/include/stl2/detail/variant/fwd.hpp index 8ff071041..437302702 100644 --- a/include/stl2/detail/variant/fwd.hpp +++ b/include/stl2/detail/variant/fwd.hpp @@ -92,7 +92,7 @@ STL2_OPEN_NAMESPACE { constexpr std::size_t index_of_type = I; template - requires(models::Destructible> && ...) + requires (Destructible>() && ...) class base; // VariantTypes is a list of the alternative types of T if @@ -121,7 +121,7 @@ STL2_OPEN_NAMESPACE { } // namespace __variant template - requires(models::Destructible<__variant::element_t> && ...) + requires (Destructible<__variant::element_t>() && ...) class variant; class bad_variant_access : public std::logic_error { diff --git a/include/stl2/optional.hpp b/include/stl2/optional.hpp index 92e3d9a6d..8677b7d60 100644 --- a/include/stl2/optional.hpp +++ b/include/stl2/optional.hpp @@ -46,7 +46,7 @@ STL2_OPEN_NAMESPACE { }; template - requires models::Destructible && _Is + requires Destructible() && _Is class optional; namespace __optional { @@ -57,31 +57,31 @@ STL2_OPEN_NAMESPACE { template requires - models::Swappable && - models::Constructible && - models::Constructible + Swappable() && + Constructible() && + Constructible() void swap(optional& lhs, optional& rhs) STL2_NOEXCEPT_RETURN( lhs.swap(rhs) ) template requires - models::Swappable && - models::MoveConstructible + Swappable() && + MoveConstructible() void swap(optional& lhs, optional& rhs) STL2_NOEXCEPT_RETURN( lhs.swap(rhs) ) template - requires models::Destructible + requires Destructible() class storage_destruct_layer { public: ~storage_destruct_layer() { if (engaged_) clear(); } constexpr storage_destruct_layer() noexcept {} template - requires models::Constructible + requires Constructible() constexpr explicit storage_destruct_layer(in_place_t, Args&&... args) noexcept(std::is_nothrow_constructible::value) : item_(std::forward(args)...), engaged_{true} {} @@ -100,13 +100,13 @@ STL2_OPEN_NAMESPACE { template requires - models::Destructible && + Destructible() && std::is_trivially_destructible::value class storage_destruct_layer { public: constexpr storage_destruct_layer() noexcept {} template - requires models::Constructible + requires Constructible() constexpr explicit storage_destruct_layer(in_place_t, Args&&... args) noexcept(std::is_nothrow_constructible::value) : item_(std::forward(args)...), engaged_{true} {} @@ -125,7 +125,7 @@ STL2_OPEN_NAMESPACE { template class storage_construct_layer : public storage_destruct_layer { public: -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 storage_construct_layer() = default; template requires models::Constructible @@ -138,7 +138,7 @@ STL2_OPEN_NAMESPACE { #endif // STL2_WORKAROUND_GCC_79143 template - requires models::Constructible + requires Constructible() void construct(Args&&... args) noexcept(std::is_nothrow_constructible::value) { @@ -178,7 +178,7 @@ STL2_OPEN_NAMESPACE { template class smf_layer : public storage_construct_layer { public: -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr explicit smf_layer(in_place_t, Args&&... args) @@ -208,7 +208,7 @@ STL2_OPEN_NAMESPACE { { return assign(std::move(that)); } private: template - requires models::Same> + requires Same>() void construct_from(That&& that) & noexcept(std::is_nothrow_constructible::value) { @@ -217,7 +217,7 @@ STL2_OPEN_NAMESPACE { } } template - requires models::Same> + requires Same>() smf_layer& assign(That&& that) & noexcept(std::is_nothrow_constructible::value && std::is_nothrow_assignable::value) @@ -238,7 +238,7 @@ STL2_OPEN_NAMESPACE { template requires std::is_trivially_copyable::value struct smf_layer : storage_construct_layer { -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 smf_layer() = default; template @@ -257,14 +257,14 @@ STL2_OPEN_NAMESPACE { template struct optional_storage {}; template - requires models::Destructible + requires Destructible() struct optional_storage { using type = __optional::smf_layer; }; } // namespace ext template - requires models::Destructible && _Is + requires Destructible() && _Is class optional : public meta::_t> , detail::smf_control::copy> @@ -309,56 +309,56 @@ STL2_OPEN_NAMESPACE { optional(optional&&) = default; template - requires models::Constructible + requires Constructible() constexpr explicit optional(in_place_t, Args&&... args) : base_t{in_place, std::forward(args)...} {} template - requires models::Constructible&, Args...> + requires Constructible&, Args...>() constexpr explicit optional(in_place_t, std::initializer_list il, Args&&... args) : base_t{in_place, il, std::forward(args)...} {} template requires - !models::Same && - !models::Same> && - models::Constructible + !Same() && + !Same>() && + Constructible() constexpr explicit optional(U&& u) noexcept(std::is_nothrow_constructible::value) : base_t{in_place, std::forward(u)} {} template requires - !models::Same && - !models::Same> && - models::Constructible && - models::ConvertibleTo + !Same() && + !Same>() && + Constructible() && + ConvertibleTo() constexpr optional(U&& u) noexcept(std::is_nothrow_constructible::value) : base_t{in_place, std::forward(u)} {} template requires - models::Constructible && + Constructible() && should_unwrap_construct explicit optional(const optional& that) noexcept(std::is_nothrow_constructible::value) { if (that) this->construct(*that); } template requires - models::Constructible && + Constructible() && should_unwrap_construct && - models::ConvertibleTo + ConvertibleTo() optional(const optional& that) noexcept(std::is_nothrow_constructible::value) { if (that) this->construct(*that); } template requires - models::Constructible + Constructible() explicit optional(optional&& that) noexcept(std::is_nothrow_constructible::value) { if (that) this->construct(std::move(*that)); } template requires - models::Constructible && - models::ConvertibleTo + Constructible() && + ConvertibleTo() optional(optional&& that) noexcept(std::is_nothrow_constructible::value) { if (that) this->construct(std::move(*that)); } @@ -374,10 +374,10 @@ STL2_OPEN_NAMESPACE { template requires - !models::Same> && - !(std::is_scalar::value && models::Same>) && - models::Constructible && - models::Assignable + !Same>() && + !(std::is_scalar::value && Same>()) && + Constructible() && + Assignable() optional& operator=(U&& u) & noexcept(std::is_nothrow_assignable::value && std::is_nothrow_constructible::value) @@ -392,8 +392,8 @@ STL2_OPEN_NAMESPACE { template requires - models::Constructible && - models::Assignable && + Constructible() && + Assignable() && should_unwrap_assign optional& operator=(const optional& that) & noexcept(std::is_nothrow_constructible::value && @@ -413,8 +413,8 @@ STL2_OPEN_NAMESPACE { template requires - models::Constructible && - models::Assignable && + Constructible() && + Assignable() && should_unwrap_assign optional& operator=(optional&& that) & noexcept(std::is_nothrow_constructible::value && @@ -433,7 +433,7 @@ STL2_OPEN_NAMESPACE { } template - requires models::Constructible + requires Constructible() void emplace(Args&&...args) noexcept(std::is_nothrow_constructible::value) { @@ -441,7 +441,7 @@ STL2_OPEN_NAMESPACE { this->construct(std::forward(args)...); } template - requires models::Constructible&, Args...> + requires Constructible&, Args...>() void emplace(std::initializer_list il, Args&&...args) noexcept(std::is_nothrow_constructible&, Args...>::value) @@ -452,9 +452,9 @@ STL2_OPEN_NAMESPACE { template requires - models::Swappable && - models::Constructible && - models::Constructible + Swappable() && + Constructible() && + Constructible() void swap(optional& that) noexcept(is_nothrow_swappable_v && std::is_nothrow_constructible::value && @@ -508,8 +508,8 @@ STL2_OPEN_NAMESPACE { template U> requires - models::ConvertibleTo && - models::CopyConstructible + ConvertibleTo() && + CopyConstructible() constexpr T value_or(U&& u) const & { return *this ? **this @@ -517,8 +517,8 @@ STL2_OPEN_NAMESPACE { } template requires - models::ConvertibleTo && - models::MoveConstructible + ConvertibleTo() && + MoveConstructible() constexpr T value_or(U&& u) && { return *this ? std::move(**this) @@ -529,59 +529,41 @@ STL2_OPEN_NAMESPACE { }; namespace __optional { - template - constexpr bool can_eq = false; template - requires + concept bool can_eq = requires(const T& t, const U& u) { - STL2_DEDUCTION_CONSTRAINT(t == u, Boolean); - } - constexpr bool can_eq = true; + { t == u } -> Boolean; + }; - template - constexpr bool can_neq = false; template - requires + concept bool can_neq = requires(const T& t, const U& u) { - STL2_DEDUCTION_CONSTRAINT(t != u, Boolean); - } - constexpr bool can_neq = true; + { t != u } -> Boolean; + }; - template - constexpr bool can_lt = false; template - requires + concept bool can_lt = requires(const T& t, const U& u) { - STL2_DEDUCTION_CONSTRAINT(t < u, Boolean); - } - constexpr bool can_lt = true; + { t < u } -> Boolean; + }; - template - constexpr bool can_gt = false; template - requires + concept bool can_gt = requires(const T& t, const U& u) { - STL2_DEDUCTION_CONSTRAINT(t > u, Boolean); - } - constexpr bool can_gt = true; + { t > u } -> Boolean; + }; - template - constexpr bool can_lte = false; template - requires + concept bool can_lte = requires(const T& t, const U& u) { - STL2_DEDUCTION_CONSTRAINT(t <= u, Boolean); - } - constexpr bool can_lte = true; + { t <= u } -> Boolean; + }; - template - constexpr bool can_gte = false; template - requires + concept bool can_gte = requires(const T& t, const U& u) { - STL2_DEDUCTION_CONSTRAINT(t >= u, Boolean); - } - constexpr bool can_gte = true; + { t >= u } -> Boolean; + }; template requires can_eq diff --git a/include/stl2/type_traits.hpp b/include/stl2/type_traits.hpp index 8b515ec3f..e2c07ec31 100644 --- a/include/stl2/type_traits.hpp +++ b/include/stl2/type_traits.hpp @@ -166,26 +166,25 @@ STL2_OPEN_NAMESPACE { struct common_reference : common_reference, V, W...> {}; - namespace models { - template - constexpr bool CommonReference = false; - template - requires + // Not to spec + // See https://github.com/ericniebler/stl2/issues/311 + template + concept bool CommonReference() { + return requires { typename common_reference_t; typename common_reference_t; } && - Same, common_reference_t> && - ConvertibleTo> && - ConvertibleTo> - constexpr bool CommonReference = true; + Same, common_reference_t>() && + ConvertibleTo>() && + ConvertibleTo>(); } - // Not to spec - // See https://github.com/ericniebler/stl2/issues/311 - template - concept bool CommonReference() { - return models::CommonReference; + namespace models { + template + constexpr bool CommonReference = false; + __stl2::CommonReference{T, U} + constexpr bool CommonReference = true; } /////////////////////////////////////////////////////////////////////////// @@ -202,31 +201,30 @@ STL2_OPEN_NAMESPACE { // This concept augments the axiom with added syntax requirements to // provide "SomewhatVerifiablyCommon." // - namespace models { - template - constexpr bool Common = false; - template - requires + // Not to spec + // See https://github.com/ericniebler/stl2/issues/311 + template + concept bool Common() { + return requires { typename common_type_t; typename common_type_t; } && - Same, common_type_t> && - ConvertibleTo> && - ConvertibleTo> && + Same, common_type_t>() && + ConvertibleTo>() && + ConvertibleTo>() && CommonReference, - add_lvalue_reference_t> && + add_lvalue_reference_t>() && CommonReference>, common_reference_t, - add_lvalue_reference_t>> - constexpr bool Common = true; + add_lvalue_reference_t>>(); } - // Not to spec - // See https://github.com/ericniebler/stl2/issues/311 - template - concept bool Common() { - return models::Common; + namespace models { + template + constexpr bool Common = false; + __stl2::Common{T, U} + constexpr bool Common = true; } template diff --git a/include/stl2/variant.hpp b/include/stl2/variant.hpp index c212b2224..9eca087b1 100644 --- a/include/stl2/variant.hpp +++ b/include/stl2/variant.hpp @@ -157,7 +157,7 @@ STL2_OPEN_NAMESPACE { // __variant::base: lowest layer of the variant implementation. // template - requires(models::Destructible> && ...) + requires(Destructible>() && ...) class base { friend v_access; protected: @@ -434,7 +434,7 @@ STL2_OPEN_NAMESPACE { destruct_base& operator=(destruct_base&&) & = default; destruct_base& operator=(const destruct_base&) & = default; -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr destruct_base(Args&&... args) @@ -449,7 +449,7 @@ STL2_OPEN_NAMESPACE { class destruct_base : public base { using base_t = base; public: -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr destruct_base(Args&&... args) @@ -472,7 +472,7 @@ STL2_OPEN_NAMESPACE { move_base& operator=(move_base&&) & = default; move_base& operator=(const move_base&) & = default; -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr move_base(Args&&... args) @@ -483,7 +483,7 @@ STL2_OPEN_NAMESPACE { }; template - requires(models::MoveConstructible> && ...) + requires(MoveConstructible>() && ...) class move_base : public destruct_base { using base_t = destruct_base; public: @@ -497,7 +497,7 @@ STL2_OPEN_NAMESPACE { move_base& operator=(move_base&&) & = default; move_base& operator=(const move_base&) & = default; -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr move_base(Args&&... args) @@ -509,12 +509,12 @@ STL2_OPEN_NAMESPACE { template requires - (models::MoveConstructible> && ...) && + (MoveConstructible>() && ...) && ext::TriviallyMoveConstructible...>>() class move_base : public destruct_base { using base_t = destruct_base; public: -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr move_base(Args&&... args) @@ -537,7 +537,7 @@ STL2_OPEN_NAMESPACE { move_assign_base& operator=(move_assign_base&&) & = delete; move_assign_base& operator=(const move_assign_base&) & = default; -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr move_assign_base(Args&&... args) @@ -548,7 +548,7 @@ STL2_OPEN_NAMESPACE { }; template - requires(models::Movable> && ...) + requires(Movable>() && ...) class move_assign_base : public move_base { using base_t = move_base; public: @@ -567,7 +567,7 @@ STL2_OPEN_NAMESPACE { } move_assign_base& operator=(const move_assign_base&) & = default; -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr move_assign_base(Args&&... args) @@ -579,12 +579,12 @@ STL2_OPEN_NAMESPACE { template requires - (models::Movable> && ...) && + (Movable>() && ...) && ext::TriviallyMovable...>>() class move_assign_base : public move_base { using base_t = move_base; public: -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr move_assign_base(Args&&... args) @@ -607,7 +607,7 @@ STL2_OPEN_NAMESPACE { copy_base& operator=(copy_base&&) & = default; copy_base& operator=(const copy_base&) & = default; -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr copy_base(Args&&... args) @@ -618,7 +618,7 @@ STL2_OPEN_NAMESPACE { }; template - requires(models::CopyConstructible> && ...) + requires(CopyConstructible>() && ...) class copy_base : public move_assign_base { using base_t = move_assign_base; public: @@ -632,7 +632,7 @@ STL2_OPEN_NAMESPACE { copy_base& operator=(copy_base&&) & = default; copy_base& operator=(const copy_base&) & = default; -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr copy_base(Args&&... args) @@ -644,12 +644,12 @@ STL2_OPEN_NAMESPACE { template requires - (models::CopyConstructible> && ...) && + (CopyConstructible>() && ...) && ext::TriviallyCopyConstructible...>>() class copy_base : public move_assign_base { using base_t = move_assign_base; public: -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr copy_base(Args&&... args) @@ -672,7 +672,7 @@ STL2_OPEN_NAMESPACE { copy_assign_base& operator=(copy_assign_base&&) & = default; copy_assign_base& operator=(const copy_assign_base&) & = delete; -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr copy_assign_base(Args&&... args) @@ -683,7 +683,7 @@ STL2_OPEN_NAMESPACE { }; template - requires(models::Copyable> && ...) + requires(Copyable>() && ...) class copy_assign_base : public copy_base { using base_t = copy_base; public: @@ -702,7 +702,7 @@ STL2_OPEN_NAMESPACE { return *this; } -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr copy_assign_base(Args&&... args) @@ -714,12 +714,12 @@ STL2_OPEN_NAMESPACE { template requires - (models::Copyable> && ...) && + (Copyable>() && ...) && ext::TriviallyCopyable...>>() class copy_assign_base : public copy_base { using base_t = copy_base; public: -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires models::Constructible constexpr copy_assign_base(Args&&... args) @@ -735,7 +735,7 @@ STL2_OPEN_NAMESPACE { // operators, and converting assignments. // template - requires(models::Destructible<__variant::element_t> && ...) + requires(Destructible<__variant::element_t>() && ...) class variant : public __variant::copy_assign_base { using base_t = __variant::copy_assign_base; @@ -776,7 +776,7 @@ STL2_OPEN_NAMESPACE { public: using types = meta::list; -#if STL2_WORKAROUND_GCC_79143 +#if 0 //STL2_WORKAROUND_GCC_79143 template requires !models::Same> && @@ -866,7 +866,7 @@ STL2_OPEN_NAMESPACE { __variant::element_t&, __variant::element_t&>...>>) requires Movable() && // Movable() explodes here. - (models::Swappable<__variant::element_t&> && ...) + (Swappable<__variant::element_t&>() && ...) { if (this->index_ == that.index_) { if (this->valid()) { @@ -886,7 +886,7 @@ STL2_OPEN_NAMESPACE { } friend constexpr bool operator==(const variant& lhs, const variant& rhs) - requires(models::EqualityComparable<__variant::element_t> && ...) + requires(EqualityComparable<__variant::element_t>() && ...) { if (lhs.index_ != rhs.index_) { return false; @@ -895,13 +895,13 @@ STL2_OPEN_NAMESPACE { } friend constexpr bool operator!=(const variant& lhs, const variant& rhs) - requires(models::EqualityComparable<__variant::element_t> && ...) + requires(EqualityComparable<__variant::element_t>() && ...) { return !(lhs == rhs); } friend constexpr bool operator<(const variant& lhs, const variant& rhs) - requires(models::StrictTotallyOrdered<__variant::element_t> && ...) + requires(StrictTotallyOrdered<__variant::element_t>() && ...) { if (lhs.index_ < rhs.index_) { return true; @@ -913,19 +913,19 @@ STL2_OPEN_NAMESPACE { } friend constexpr bool operator>(const variant& lhs, const variant& rhs) - requires(models::StrictTotallyOrdered<__variant::element_t> && ...) + requires(StrictTotallyOrdered<__variant::element_t>() && ...) { return rhs < lhs; } friend constexpr bool operator<=(const variant& lhs, const variant& rhs) - requires(models::StrictTotallyOrdered<__variant::element_t> && ...) + requires(StrictTotallyOrdered<__variant::element_t>() && ...) { return !(rhs < lhs); } friend constexpr bool operator>=(const variant& lhs, const variant& rhs) - requires(models::StrictTotallyOrdered<__variant::element_t> && ...) + requires(StrictTotallyOrdered<__variant::element_t>() && ...) { return !(lhs < rhs); } diff --git a/test/concepts/compare.cpp b/test/concepts/compare.cpp index b97ee2835..83ce32c16 100644 --- a/test/concepts/compare.cpp +++ b/test/concepts/compare.cpp @@ -60,20 +60,24 @@ struct A { CONCEPT_ASSERT(models::EqualityComparable); CONCEPT_ASSERT(models::EqualityComparable); CONCEPT_ASSERT(!models::EqualityComparable); +CONCEPT_ASSERT(models::EqualityComparable); CONCEPT_ASSERT(models::EqualityComparable); CONCEPT_ASSERT(models::EqualityComparable); CONCEPT_ASSERT(!models::EqualityComparable); +CONCEPT_ASSERT(models::EqualityComparable); } // namespace equality_comparable_test CONCEPT_ASSERT(models::StrictTotallyOrdered); CONCEPT_ASSERT(models::StrictTotallyOrdered); CONCEPT_ASSERT(models::StrictTotallyOrdered); CONCEPT_ASSERT(!models::StrictTotallyOrdered); +CONCEPT_ASSERT(models::StrictTotallyOrdered); CONCEPT_ASSERT(models::StrictTotallyOrdered); CONCEPT_ASSERT(models::StrictTotallyOrdered); CONCEPT_ASSERT(!models::StrictTotallyOrdered); +CONCEPT_ASSERT(models::StrictTotallyOrdered); int main() { return ::test_result();