This patch also renames __cpp_lib_fold to __cpp_lib_ranges_fold
as per the current draft standard.
libstdc++-v3/ChangeLog:
* include/bits/ranges_algo.h (__cpp_lib_ranges_contains):
Define for C++23.
(__cpp_lib_ranges_iota): Likewise.
(__cpp_lib_ranges_find_last): Likewise.
(__cpp_lib_fold): Rename to ...
(__cpp_lib_ranges_fold): ... this.
* include/std/version: As above.
* testsuite/25_algorithms/fold_left/1.cc: Adjust after
renaming __cpp_lib_fold.
* testsuite/std/ranges/version_c++23.cc: Verify values
of the above feature-test macros.
(cherry picked from commit
95525c5b8c2d6317b693d441520b7bc808cf9ec7)
inline constexpr __prev_permutation_fn prev_permutation{};
#if __cplusplus > 202002L
+
+#define __cpp_lib_ranges_contains 202207L
+
struct __contains_fn
{
template<input_iterator _Iter, sentinel_for<_Iter> _Sent,
inline constexpr __contains_subrange_fn contains_subrange{};
+#define __cpp_lib_ranges_iota 202202L
+
template<typename _Out, typename _Tp>
struct out_value_result
{
inline constexpr __iota_fn iota{};
+#define __cpp_lib_ranges_find_last 202207L
+
struct __find_last_fn
{
template<forward_iterator _Iter, sentinel_for<_Iter> _Sent, typename _Tp, typename _Proj = identity>
inline constexpr __find_last_if_not_fn find_last_if_not{};
-#define __cpp_lib_fold 202207L
+#define __cpp_lib_ranges_fold 202207L
template<typename _Iter, typename _Tp>
struct in_value_result
#define __cpp_lib_ranges_as_rvalue 202207L
#define __cpp_lib_ranges_as_const 202207L
#define __cpp_lib_ranges_enumerate 202302L
-#define __cpp_lib_fold 202207L
+#define __cpp_lib_ranges_contains 202207L
+#define __cpp_lib_ranges_iota 202202L
+#define __cpp_lib_ranges_find_last 202207L
+#define __cpp_lib_ranges_fold 202207L
#if __cpp_constexpr_dynamic_alloc
# if _GLIBCXX_HOSTED
# define __cpp_lib_constexpr_bitset 202202L
#include <ranges>
#include <testsuite_iterators.h>
-#if __cpp_lib_fold != 202207L
-# error "Feature-test macro __cpp_lib_fold has wrong value in <algorithm>"
+#if __cpp_lib_ranges_fold != 202207L
+# error "Feature-test macro __cpp_lib_ranges_fold has wrong value in <algorithm>"
#endif
namespace ranges = std::ranges;
#if __cpp_lib_ranges_enumerate != 202302L
# error "Feature-test macro __cpp_lib_ranges_enumerate has wrong value in <version>"
#endif
+
+#if __cpp_lib_ranges_contains != 202207L
+# error "Feature-test macro __cpp_lib_ranges_contains has wrong value in <version>"
+#endif
+
+#if __cpp_lib_ranges_iota != 202202L
+# error "Feature-test macro __cpp_lib_ranges_iota has wrong value in <version>"
+#endif
+
+#if __cpp_lib_ranges_find_last != 202207L
+# error "Feature-test macro __cpp_lib_ranges_find_last has wrong value in <version>"
+#endif
+
+#if __cpp_lib_ranges_fold != 202207L
+# error "Feature-test macro __cpp_lib_ranges_fold has wrong value in <version>"
+#endif