aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/__iterator/next.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/__iterator/next.h')
-rw-r--r--libcxx/include/__iterator/next.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/libcxx/include/__iterator/next.h b/libcxx/include/__iterator/next.h
index d332abfa8e0e..b9bdd6b27e05 100644
--- a/libcxx/include/__iterator/next.h
+++ b/libcxx/include/__iterator/next.h
@@ -12,7 +12,6 @@
#include <__config>
#include <__debug>
-#include <__function_like.h>
#include <__iterator/advance.h>
#include <__iterator/concepts.h>
#include <__iterator/incrementable_traits.h>
@@ -38,12 +37,12 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
#if !defined(_LIBCPP_HAS_NO_RANGES)
+// [range.iter.op.next]
+
namespace ranges {
-// TODO(varconst): rename `__next_fn` to `__fn`.
-struct __next_fn final : private __function_like {
- _LIBCPP_HIDE_FROM_ABI
- constexpr explicit __next_fn(__tag __x) noexcept : __function_like(__x) {}
+namespace __next {
+struct __fn {
template <input_or_output_iterator _Ip>
_LIBCPP_HIDE_FROM_ABI
constexpr _Ip operator()(_Ip __x) const {
@@ -73,7 +72,11 @@ struct __next_fn final : private __function_like {
}
};
-inline constexpr auto next = __next_fn(__function_like::__tag());
+} // namespace __next
+
+inline namespace __cpo {
+ inline constexpr auto next = __next::__fn{};
+} // namespace __cpo
} // namespace ranges
#endif // !defined(_LIBCPP_HAS_NO_RANGES)