Skip to content

Commit

Permalink
Fix up Boolean, EqualityComparable, and StrictTotallyOrdered (refs er…
Browse files Browse the repository at this point in the history
…icniebler/stl2#155); remove argument deduction constraint work-arounds; fix up deduction constraints (refs ericniebler/stl2#331)
  • Loading branch information
ericniebler committed Feb 17, 2017
1 parent 546f50f commit b5329bf
Show file tree
Hide file tree
Showing 111 changed files with 1,115 additions and 1,280 deletions.
12 changes: 6 additions & 6 deletions include/stl2/detail/algorithm/adjacent_find.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ STL2_OPEN_NAMESPACE {
template <ForwardIterator I, Sentinel<I> S, class Pred = equal_to<>,
class Proj = identity>
requires
models::IndirectRelation<
Pred, projected<I, Proj>>
IndirectRelation<
Pred, projected<I, Proj>>()
I adjacent_find(I first, S last, Pred pred = Pred{}, Proj proj = Proj{})
{
if (first == last) {
Expand All @@ -44,8 +44,8 @@ STL2_OPEN_NAMESPACE {

template <ForwardRange Rng, class Pred = equal_to<>, class Proj = identity>
requires
models::IndirectRelation<
Pred, projected<iterator_t<Rng>, Proj>>
IndirectRelation<
Pred, projected<iterator_t<Rng>, Proj>>()
safe_iterator_t<Rng>
adjacent_find(Rng&& rng, Pred pred = Pred{}, Proj proj = Proj{})
{
Expand All @@ -57,8 +57,8 @@ STL2_OPEN_NAMESPACE {
// Extension
template <class E, class Pred = equal_to<>, class Proj = identity>
requires
models::IndirectRelation<
Pred, projected<const E*, Proj>>
IndirectRelation<
Pred, projected<const E*, Proj>>()
dangling<const E*>
adjacent_find(std::initializer_list<E>&& rng, Pred pred = Pred{}, Proj proj = Proj{})
{
Expand Down
12 changes: 6 additions & 6 deletions include/stl2/detail/algorithm/all_of.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
STL2_OPEN_NAMESPACE {
template <InputIterator I, Sentinel<I> S, class Pred, class Proj = identity>
requires
models::IndirectPredicate<
Pred, projected<I, Proj>>
IndirectPredicate<
Pred, projected<I, Proj>>()
bool all_of(I first, S last, Pred pred, Proj proj = Proj{})
{
if (first != last) {
Expand All @@ -43,8 +43,8 @@ STL2_OPEN_NAMESPACE {

template <InputRange R, class Pred, class Proj = identity>
requires
models::IndirectPredicate<
Pred, projected<iterator_t<R>, Proj>>
IndirectPredicate<
Pred, projected<iterator_t<R>, Proj>>()
bool all_of(R&& rng, Pred pred, Proj proj = Proj{})
{
return __stl2::all_of(__stl2::begin(rng), __stl2::end(rng),
Expand All @@ -54,8 +54,8 @@ STL2_OPEN_NAMESPACE {
// Extension
template <class E, class Pred, class Proj = identity>
requires
models::IndirectPredicate<
Pred, projected<const E*, Proj>>
IndirectPredicate<
Pred, projected<const E*, Proj>>()
bool all_of(std::initializer_list<E> il, Pred pred, Proj proj = Proj{})
{
return __stl2::all_of(il.begin(), il.end(),
Expand Down
12 changes: 6 additions & 6 deletions include/stl2/detail/algorithm/any_of.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
STL2_OPEN_NAMESPACE {
template <InputIterator I, Sentinel<I> S, class Pred, class Proj = identity>
requires
models::IndirectPredicate<
Pred, projected<I, Proj>>
IndirectPredicate<
Pred, projected<I, Proj>>()
bool any_of(I first, S last, Pred pred, Proj proj = Proj{})
{
if (first != last) {
Expand All @@ -42,8 +42,8 @@ STL2_OPEN_NAMESPACE {

template <InputRange R, class Pred, class Proj = identity>
requires
models::IndirectPredicate<
Pred, projected<iterator_t<R>, Proj>>
IndirectPredicate<
Pred, projected<iterator_t<R>, Proj>>()
bool any_of(R&& rng, Pred pred, Proj proj = Proj{})
{
return __stl2::any_of(__stl2::begin(rng), __stl2::end(rng),
Expand All @@ -53,8 +53,8 @@ STL2_OPEN_NAMESPACE {
// Extension
template <class E, class Pred, class Proj = identity>
requires
models::IndirectPredicate<
Pred, projected<const E*, Proj>>
IndirectPredicate<
Pred, projected<const E*, Proj>>()
bool any_of(std::initializer_list<E> il, Pred pred, Proj proj = Proj{})
{
return __stl2::any_of(il.begin(), il.end(),
Expand Down
12 changes: 6 additions & 6 deletions include/stl2/detail/algorithm/binary_search.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ STL2_OPEN_NAMESPACE {
template <ForwardIterator I, Sentinel<I> S, class T,
class Comp = less<>, class Proj = identity>
requires
models::IndirectStrictWeakOrder<
Comp, const T*, projected<I, Proj>>
IndirectStrictWeakOrder<
Comp, const T*, projected<I, Proj>>()
bool binary_search(I first, S last, const T& value, Comp comp = Comp{},
Proj proj = Proj{})
{
Expand All @@ -37,8 +37,8 @@ STL2_OPEN_NAMESPACE {

template <ForwardRange Rng, class T, class Comp = less<>, class Proj = identity>
requires
models::IndirectStrictWeakOrder<
Comp, const T*, projected<iterator_t<Rng>, Proj>>
IndirectStrictWeakOrder<
Comp, const T*, projected<iterator_t<Rng>, Proj>>()
bool binary_search(Rng&& rng, const T& value, Comp comp = Comp{}, Proj proj = Proj{})
{
return __stl2::binary_search(
Expand All @@ -49,8 +49,8 @@ STL2_OPEN_NAMESPACE {
// Extension
template <class E, class T, class Comp = less<>, class Proj = identity>
requires
models::IndirectStrictWeakOrder<
Comp, const T*, projected<const E*, Proj>>
IndirectStrictWeakOrder<
Comp, const T*, projected<const E*, Proj>>()
bool binary_search(std::initializer_list<E>&& rng, const T& value,
Comp comp = Comp{}, Proj proj = Proj{})
{
Expand Down
16 changes: 8 additions & 8 deletions include/stl2/detail/algorithm/copy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
STL2_OPEN_NAMESPACE {
template <InputIterator I, Sentinel<I> S, WeaklyIncrementable O>
requires
models::IndirectlyCopyable<I, O>
IndirectlyCopyable<I, O>()
tagged_pair<tag::in(I), tag::out(O)>
copy(I first, S last, O result)
{
Expand All @@ -34,8 +34,8 @@ STL2_OPEN_NAMESPACE {

template <InputRange Rng, class O>
requires
models::WeaklyIncrementable<__f<O>> &&
models::IndirectlyCopyable<iterator_t<Rng>, __f<O>>
WeaklyIncrementable<__f<O>>() &&
IndirectlyCopyable<iterator_t<Rng>, __f<O>>()
tagged_pair<tag::in(safe_iterator_t<Rng>), tag::out(__f<O>)>
copy(Rng&& rng, O&& result)
{
Expand All @@ -46,8 +46,8 @@ STL2_OPEN_NAMESPACE {
// Extension
template <class E, class O>
requires
models::WeaklyIncrementable<__f<O>> &&
models::IndirectlyCopyable<const E*, __f<O>>
WeaklyIncrementable<__f<O>>() &&
IndirectlyCopyable<const E*, __f<O>>()
tagged_pair<tag::in(dangling<const E*>), tag::out(__f<O>)>
copy(std::initializer_list<E>&& rng, O&& result)
{
Expand All @@ -58,7 +58,7 @@ STL2_OPEN_NAMESPACE {
namespace ext {
template <InputIterator I1, Sentinel<I1> S1, Iterator I2, Sentinel<I2> S2>
requires
models::IndirectlyCopyable<I1, I2>
IndirectlyCopyable<I1, I2>()
tagged_pair<tag::in(I1), tag::out(I2)>
copy(I1 first, S1 last, I2 result_first, S2 result_last)
{
Expand All @@ -70,7 +70,7 @@ STL2_OPEN_NAMESPACE {

template <InputRange Rng1, Range Rng2>
requires
models::IndirectlyCopyable<iterator_t<Rng1>, iterator_t<Rng2>>
IndirectlyCopyable<iterator_t<Rng1>, iterator_t<Rng2>>()
tagged_pair<tag::in(safe_iterator_t<Rng1>), tag::out(safe_iterator_t<Rng2>)>
copy(Rng1&& rng1, Rng2&& rng2)
{
Expand All @@ -80,7 +80,7 @@ STL2_OPEN_NAMESPACE {

template <class E, Range Rng2>
requires
models::IndirectlyCopyable<const E*, iterator_t<Rng2>>
IndirectlyCopyable<const E*, iterator_t<Rng2>>()
tagged_pair<tag::in(dangling<const E*>), tag::out(safe_iterator_t<Rng2>)>
copy(std::initializer_list<E>&& rng1, Rng2&& rng2)
{
Expand Down
10 changes: 5 additions & 5 deletions include/stl2/detail/algorithm/copy_backward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
STL2_OPEN_NAMESPACE {
template <BidirectionalIterator I1, Sentinel<I1> S1, BidirectionalIterator I2>
requires
models::IndirectlyCopyable<I1, I2>
IndirectlyCopyable<I1, I2>()
tagged_pair<tag::in(I1), tag::out(I2)>
copy_backward(I1 first, S1 sent, I2 out)
{
Expand All @@ -38,8 +38,8 @@ STL2_OPEN_NAMESPACE {

template <BidirectionalRange Rng, class I>
requires
models::BidirectionalIterator<__f<I>> &&
models::IndirectlyCopyable<iterator_t<Rng>, __f<I>>
BidirectionalIterator<__f<I>>() &&
IndirectlyCopyable<iterator_t<Rng>, __f<I>>()
tagged_pair<tag::in(safe_iterator_t<Rng>), tag::out(__f<I>)>
copy_backward(Rng&& rng, I&& result)
{
Expand All @@ -51,8 +51,8 @@ STL2_OPEN_NAMESPACE {
// Extension
template <class E, class I>
requires
models::BidirectionalIterator<__f<I>> &&
models::IndirectlyCopyable<const E*, __f<I>>
BidirectionalIterator<__f<I>>() &&
IndirectlyCopyable<const E*, __f<I>>()
tagged_pair<tag::in(dangling<const E*>), tag::out(__f<I>)>
copy_backward(std::initializer_list<E>&& rng, I&& result)
{
Expand Down
22 changes: 11 additions & 11 deletions include/stl2/detail/algorithm/copy_if.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ STL2_OPEN_NAMESPACE {
template <InputIterator I, Sentinel<I> S, WeaklyIncrementable O,
class Pred, class Proj = identity>
requires
models::IndirectlyCopyable<I, O> &&
models::IndirectPredicate<
Pred, projected<I, Proj>>
IndirectlyCopyable<I, O>() &&
IndirectPredicate<
Pred, projected<I, Proj>>()
tagged_pair<tag::in(I), tag::out(O)>
copy_if(I first, S last, O result, Pred pred, Proj proj = Proj{})
{
Expand All @@ -45,10 +45,10 @@ STL2_OPEN_NAMESPACE {

template <InputRange Rng, class O, class Pred, class Proj = identity>
requires
models::WeaklyIncrementable<__f<O>> &&
models::IndirectPredicate<
Pred, projected<iterator_t<Rng>, Proj>> &&
models::IndirectlyCopyable<iterator_t<Rng>, __f<O>>
WeaklyIncrementable<__f<O>>() &&
IndirectPredicate<
Pred, projected<iterator_t<Rng>, Proj>>() &&
IndirectlyCopyable<iterator_t<Rng>, __f<O>>()
tagged_pair<tag::in(safe_iterator_t<Rng>), tag::out(__f<O>)>
copy_if(Rng&& rng, O&& result, Pred pred, Proj proj = Proj{})
{
Expand All @@ -60,10 +60,10 @@ STL2_OPEN_NAMESPACE {
// Extension
template <class E, class O, class Pred, class Proj = identity>
requires
models::WeaklyIncrementable<__f<O>> &&
models::IndirectPredicate<
Pred, projected<const E*, Proj>> &&
models::IndirectlyCopyable<const E*, __f<O>>
WeaklyIncrementable<__f<O>>() &&
IndirectPredicate<
Pred, projected<const E*, Proj>>() &&
IndirectlyCopyable<const E*, __f<O>>()
tagged_pair<tag::in(dangling<const E*>), tag::out(__f<O>)>
copy_if(std::initializer_list<E>&& rng, O&& result, Pred pred, Proj proj = Proj{})
{
Expand Down
2 changes: 1 addition & 1 deletion include/stl2/detail/algorithm/copy_n.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//
STL2_OPEN_NAMESPACE {
template <InputIterator I, WeaklyIncrementable O>
requires models::IndirectlyCopyable<I, O>
requires IndirectlyCopyable<I, O>()
tagged_pair<tag::in(I), tag::out(O)>
copy_n(I first_, difference_type_t<I> n, O result)
{
Expand Down
12 changes: 6 additions & 6 deletions include/stl2/detail/algorithm/count.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
STL2_OPEN_NAMESPACE {
template <InputIterator I, Sentinel<I> S, class T, class Proj = identity>
requires
models::IndirectRelation<
equal_to<>, projected<I, Proj>, const T*>
IndirectRelation<
equal_to<>, projected<I, Proj>, const T*>()
difference_type_t<I>
count(I first, S last, const T& value, Proj proj = Proj{})
{
Expand All @@ -39,8 +39,8 @@ STL2_OPEN_NAMESPACE {

template <InputRange Rng, class T, class Proj = identity>
requires
models::IndirectRelation<
equal_to<>, projected<iterator_t<Rng>, Proj>, const T*>
IndirectRelation<
equal_to<>, projected<iterator_t<Rng>, Proj>, const T*>()
difference_type_t<iterator_t<Rng>>
count(Rng&& rng, const T& value, Proj proj = Proj{})
{
Expand All @@ -51,8 +51,8 @@ STL2_OPEN_NAMESPACE {
// Extension
template <class E, class T, class Proj = identity>
requires
models::IndirectRelation<
equal_to<>, projected<const E*, Proj>, const T*>
IndirectRelation<
equal_to<>, projected<const E*, Proj>, const T*>()
std::ptrdiff_t
count(std::initializer_list<E>&& rng,
const T& value, Proj proj = Proj{})
Expand Down
12 changes: 6 additions & 6 deletions include/stl2/detail/algorithm/count_if.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
STL2_OPEN_NAMESPACE {
template <InputIterator I, Sentinel<I> S, class Pred, class Proj = identity>
requires
models::IndirectPredicate<
Pred, projected<I, Proj>>
IndirectPredicate<
Pred, projected<I, Proj>>()
difference_type_t<I> count_if(I first, S last, Pred pred, Proj proj = Proj{})
{
auto n = difference_type_t<I>{0};
Expand All @@ -38,8 +38,8 @@ STL2_OPEN_NAMESPACE {

template <InputRange Rng, class Pred, class Proj = identity>
requires
models::IndirectPredicate<
Pred, projected<iterator_t<Rng>, Proj>>
IndirectPredicate<
Pred, projected<iterator_t<Rng>, Proj>>()
difference_type_t<iterator_t<Rng>> count_if(Rng&& rng, Pred pred, Proj proj = Proj{})
{
return __stl2::count_if(__stl2::begin(rng), __stl2::end(rng),
Expand All @@ -48,8 +48,8 @@ STL2_OPEN_NAMESPACE {

template <class E, class Pred, class Proj = identity>
requires
models::IndirectPredicate<
Pred, projected<const E*, Proj>>
IndirectPredicate<
Pred, projected<const E*, Proj>>()
std::ptrdiff_t count_if(std::initializer_list<E>&& rng, Pred pred, Proj proj = Proj{})
{
return __stl2::count_if(rng, __stl2::ref(pred), __stl2::ref(proj));
Expand Down
Loading

0 comments on commit b5329bf

Please sign in to comment.