diff --git a/libcxx/include/__iterator/advance.h b/libcxx/include/__iterator/advance.h --- a/libcxx/include/__iterator/advance.h +++ b/libcxx/include/__iterator/advance.h @@ -67,10 +67,12 @@ #if !defined(_LIBCPP_HAS_NO_RANGES) -namespace ranges { // [range.iter.op.advance] -// TODO(varconst): rename `__advance_fn` to `__fn`. -struct __advance_fn final : private __function_like { + +namespace ranges { +namespace __advance { + +struct __fn final : private __function_like { private: template _LIBCPP_HIDE_FROM_ABI @@ -97,7 +99,7 @@ } public: - constexpr explicit __advance_fn(__tag __x) noexcept : __function_like(__x) {} + constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} // Preconditions: If `I` does not model `bidirectional_iterator`, `n` is not negative. template @@ -186,7 +188,11 @@ } }; -inline constexpr auto advance = __advance_fn(__function_like::__tag()); +} // namespace __advance + +inline namespace __cpo { + inline constexpr auto advance = __advance::__fn(__function_like::__tag()); +} // namespace __cpo } // namespace ranges #endif // !defined(_LIBCPP_HAS_NO_RANGES) diff --git a/libcxx/include/__iterator/next.h b/libcxx/include/__iterator/next.h --- a/libcxx/include/__iterator/next.h +++ b/libcxx/include/__iterator/next.h @@ -38,11 +38,14 @@ #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 { +namespace __next { + +struct __fn final : private __function_like { _LIBCPP_HIDE_FROM_ABI - constexpr explicit __next_fn(__tag __x) noexcept : __function_like(__x) {} + constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} template _LIBCPP_HIDE_FROM_ABI @@ -73,7 +76,11 @@ } }; -inline constexpr auto next = __next_fn(__function_like::__tag()); +} // namespace __next + +inline namespace __cpo { + inline constexpr auto next = __next::__fn(__function_like::__tag()); +} // namespace __cpo } // namespace ranges #endif // !defined(_LIBCPP_HAS_NO_RANGES) diff --git a/libcxx/include/__iterator/prev.h b/libcxx/include/__iterator/prev.h --- a/libcxx/include/__iterator/prev.h +++ b/libcxx/include/__iterator/prev.h @@ -37,11 +37,14 @@ #if !defined(_LIBCPP_HAS_NO_RANGES) +// [range.iter.op.prev] + namespace ranges { -// TODO(varconst): rename `__prev_fn` to `__fn`. -struct __prev_fn final : private __function_like { +namespace __prev { + +struct __fn final : private __function_like { _LIBCPP_HIDE_FROM_ABI - constexpr explicit __prev_fn(__tag __x) noexcept : __function_like(__x) {} + constexpr explicit __fn(__tag __x) noexcept : __function_like(__x) {} template _LIBCPP_HIDE_FROM_ABI @@ -65,7 +68,11 @@ } }; -inline constexpr auto prev = __prev_fn(__function_like::__tag()); +} // namespace __prev + +inline namespace __cpo { + inline constexpr auto prev = __prev::__fn(__function_like::__tag()); +} // namespace __cpo } // namespace ranges #endif // !defined(_LIBCPP_HAS_NO_RANGES)