diff --git a/libcxx/include/__algorithm/find_first_of.h b/libcxx/include/__algorithm/find_first_of.h --- a/libcxx/include/__algorithm/find_first_of.h +++ b/libcxx/include/__algorithm/find_first_of.h @@ -24,7 +24,8 @@ _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator1 __find_first_of_ce(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, - _ForwardIterator2 __last2, _BinaryPredicate __pred) { + _ForwardIterator2 __last2, + _BinaryPredicate&& __pred) { for (; __first1 != __last1; ++__first1) for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j) if (__pred(*__first1, *__j)) diff --git a/libcxx/test/libcxx/algorithms/ranges_robust_against_copying_comparators.pass.cpp b/libcxx/test/libcxx/algorithms/ranges_robust_against_copying_comparators.pass.cpp --- a/libcxx/test/libcxx/algorithms/ranges_robust_against_copying_comparators.pass.cpp +++ b/libcxx/test/libcxx/algorithms/ranges_robust_against_copying_comparators.pass.cpp @@ -121,9 +121,9 @@ (void)std::ranges::for_each(first, last, UnaryVoid(&copies)); assert(copies == 1); copies = 0; (void)std::ranges::for_each(a, UnaryVoid(&copies)); assert(copies == 1); copies = 0; (void)std::ranges::for_each_n(first, count, UnaryVoid(&copies)); assert(copies == 1); copies = 0; - //(void)std::ranges::generate(first, last, NullaryValue(&copies)); assert(copies == 0); - //(void)std::ranges::generate(a, NullaryValue(&copies)); assert(copies == 0); - //(void)std::ranges::generate_n(first, count, NullaryValue(&copies)); assert(copies == 0); + (void)std::ranges::generate(first, last, NullaryValue(&copies)); assert(copies == 0); + (void)std::ranges::generate(a, NullaryValue(&copies)); assert(copies == 0); + (void)std::ranges::generate_n(first, count, NullaryValue(&copies)); assert(copies == 0); (void)std::ranges::includes(first, last, first2, last2, Less(&copies)); assert(copies == 0); (void)std::ranges::includes(a, b, Less(&copies)); assert(copies == 0); (void)std::ranges::is_heap(first, last, Less(&copies)); assert(copies == 0); diff --git a/libcxx/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp b/libcxx/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp --- a/libcxx/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp +++ b/libcxx/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp @@ -120,7 +120,7 @@ #endif (void)std::equal_range(first, last, value, Less(&copies)); assert(copies == 0); (void)std::find_end(first, last, first2, mid2, Equal(&copies)); assert(copies == 0); - //(void)std::find_first_of(first, last, first2, last2, Equal(&copies)); assert(copies == 0); + (void)std::find_first_of(first, last, first2, last2, Equal(&copies)); assert(copies == 0); (void)std::find_if(first, last, UnaryTrue(&copies)); assert(copies == 0); (void)std::find_if_not(first, last, UnaryTrue(&copies)); assert(copies == 0); (void)std::for_each(first, last, UnaryVoid(&copies)); assert(copies == 1); copies = 0; diff --git a/libcxx/test/std/algorithms/ranges_result_alias_declarations.compile.pass.cpp b/libcxx/test/std/algorithms/ranges_result_alias_declarations.compile.pass.cpp --- a/libcxx/test/std/algorithms/ranges_result_alias_declarations.compile.pass.cpp +++ b/libcxx/test/std/algorithms/ranges_result_alias_declarations.compile.pass.cpp @@ -36,8 +36,8 @@ static_assert(std::is_same_v, remove_copy_if_result>); static_assert(std::is_same_v, replace_copy_result>); static_assert(std::is_same_v, replace_copy_if_result>); -// static_assert(std::is_same_v, reverse_copy_result>); -// static_assert(std::is_same_v, rotate_copy_result>); +static_assert(std::is_same_v, reverse_copy_result>); +static_assert(std::is_same_v, rotate_copy_result>); static_assert(std::is_same_v, set_difference_result>); static_assert(std::is_same_v, unary_transform_result>); static_assert(std::is_same_v, uninitialized_copy_result>); diff --git a/libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp b/libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp --- a/libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp +++ b/libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp @@ -76,8 +76,10 @@ using std::ranges::mismatch_result; using std::ranges::move_result; using std::ranges::move_backward_result; + using std::ranges::next_permutation_result; using std::ranges::partial_sort_copy_result; using std::ranges::partition_copy_result; + using std::ranges::prev_permutation_result; using std::ranges::remove_copy_result; using std::ranges::remove_copy_if_result; using std::ranges::replace_copy_result; @@ -199,8 +201,8 @@ dangling_1st(std::ranges::push_heap, in); dangling_1st(std::ranges::pop_heap, in); dangling_1st(std::ranges::sort_heap, in); - //dangling_1st(std::ranges::prev_permutation, in); - //dangling_1st(std::ranges::next_permutation, in); + dangling_1st>(std::ranges::prev_permutation, in); + dangling_1st>(std::ranges::next_permutation, in); return true; } diff --git a/libcxx/test/std/algorithms/ranges_robust_against_proxy_iterators.pass.cpp b/libcxx/test/std/algorithms/ranges_robust_against_proxy_iterators.pass.cpp --- a/libcxx/test/std/algorithms/ranges_robust_against_proxy_iterators.pass.cpp +++ b/libcxx/test/std/algorithms/ranges_robust_against_proxy_iterators.pass.cpp @@ -69,7 +69,6 @@ int count = 1; auto unary_pred = [](const Proxy&) { return true; }; - //auto binary_pred = [](const Proxy&, const Proxy&) { return return false; }; auto binary_func = [](const Proxy&, const Proxy&) -> Proxy { return Proxy(T()); }; auto gen = [] { return Proxy(T{42}); }; @@ -87,7 +86,7 @@ test(std::ranges::partition_point, in, unary_pred); test(std::ranges::lower_bound, in, x); test(std::ranges::upper_bound, in, x); - //test(std::ranges::equal_range, in, x); + test(std::ranges::equal_range, in, x); test(std::ranges::binary_search, in, x); test(std::ranges::min_element, in); @@ -169,8 +168,8 @@ test(std::ranges::push_heap, in); test(std::ranges::pop_heap, in); test(std::ranges::sort_heap, in); - //test(std::ranges::prev_permutation, in); - //test(std::ranges::next_permutation, in); + test(std::ranges::prev_permutation, in); + test(std::ranges::next_permutation, in); // The algorithms that work on uninitialized memory have constraints that prevent proxy iterators from being used with // them. diff --git a/libcxx/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp b/libcxx/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp --- a/libcxx/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp +++ b/libcxx/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp @@ -56,7 +56,6 @@ auto odd = [](int x) { return x % 2 != 0; }; auto triple = [](int x) { return 3*x; }; auto gen = [] { return 42; }; -//auto plus = [](int x, int y) { return x == y; }; std::mt19937 g; // [algorithm.syn] @@ -79,7 +78,7 @@ static_assert(test(std::ranges::fill_n, a, 10, 42)); static_assert(test(std::ranges::find, a, 42)); static_assert(test(std::ranges::find_end, a, a)); -//static_assert(test(std::ranges::find_first_of, a, a)); +static_assert(test(std::ranges::find_first_of, a, a)); static_assert(test(std::ranges::find_if, a, odd)); static_assert(test(std::ranges::find_if_not, a, odd)); static_assert(test(std::ranges::for_each, a, odd)); @@ -107,7 +106,7 @@ static_assert(test(std::ranges::mismatch, a, a)); static_assert(test(std::ranges::move, a, a)); static_assert(test(std::ranges::move_backward, a, a)); -//static_assert(test(std::ranges::next_permutation, a)); +static_assert(test(std::ranges::next_permutation, a)); static_assert(test(std::ranges::none_of, a, odd)); static_assert(test(std::ranges::nth_element, a, a+5)); static_assert(test(std::ranges::partial_sort, a, a+5)); @@ -116,7 +115,7 @@ static_assert(test(std::ranges::partition_copy, a, a, a, odd)); static_assert(test(std::ranges::partition_point, a, odd)); static_assert(test(std::ranges::pop_heap, a)); -//static_assert(test(std::ranges::prev_permutation, a)); +static_assert(test(std::ranges::prev_permutation, a)); static_assert(test(std::ranges::push_heap, a)); static_assert(test(std::ranges::remove, a, 42)); static_assert(test(std::ranges::remove_copy, a, a, 42));