[libcxx-commits] [libcxx] d1c4c75 - [libc++] Fix the last instances of `namespace ranges::inline...`. NFC.
Arthur O'Dwyer via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Jan 29 08:10:26 PST 2022
Author: Arthur O'Dwyer
Date: 2022-01-29T11:10:04-05:00
New Revision: d1c4c755310e5c358cf999ddf223c43f9e5b3030
URL: https://github.com/llvm/llvm-project/commit/d1c4c755310e5c358cf999ddf223c43f9e5b3030
DIFF: https://github.com/llvm/llvm-project/commit/d1c4c755310e5c358cf999ddf223c43f9e5b3030.diff
LOG: [libc++] Fix the last instances of `namespace ranges::inline...`. NFC.
Make these look the same as everywhere else.
Added:
Modified:
libcxx/include/__concepts/swappable.h
libcxx/include/__iterator/iter_move.h
libcxx/include/__iterator/iter_swap.h
libcxx/include/__ranges/enable_view.h
Removed:
################################################################################
diff --git a/libcxx/include/__concepts/swappable.h b/libcxx/include/__concepts/swappable.h
index 423b3a89fa405..d45249738535e 100644
--- a/libcxx/include/__concepts/swappable.h
+++ b/libcxx/include/__concepts/swappable.h
@@ -28,13 +28,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
// [concept.swappable]
-namespace ranges::__swap {
- // Deleted to inhibit ADL
+
+namespace ranges {
+namespace __swap {
+
template<class _Tp>
void swap(_Tp&, _Tp&) = delete;
-
- // [1]
template<class _Tp, class _Up>
concept __unqualified_swappable_with =
(__class_or_enum<remove_cvref_t<_Tp>> || __class_or_enum<remove_cvref_t<_Up>>) &&
@@ -89,11 +89,12 @@ namespace ranges::__swap {
__y = _VSTD::exchange(__x, _VSTD::move(__y));
}
};
-} // namespace ranges::__swap
+} // namespace __swap
-namespace ranges::inline __cpo {
+inline namespace __cpo {
inline constexpr auto swap = __swap::__fn{};
-} // namespace ranges::__cpo
+} // namespace __cpo
+} // namespace ranges
template<class _Tp>
concept swappable = requires(_Tp& __a, _Tp& __b) { ranges::swap(__a, __b); };
diff --git a/libcxx/include/__iterator/iter_move.h b/libcxx/include/__iterator/iter_move.h
index a2951f764b0ca..b72a5ec44884e 100644
--- a/libcxx/include/__iterator/iter_move.h
+++ b/libcxx/include/__iterator/iter_move.h
@@ -25,7 +25,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if !defined(_LIBCPP_HAS_NO_RANGES)
-namespace ranges::__iter_move {
+// [iterator.cust.move]
+
+namespace ranges {
+namespace __iter_move {
+
void iter_move();
template<class _Ip>
@@ -69,14 +73,15 @@ struct __fn {
// [iterator.cust.move]/1.3
// Otherwise, ranges::iter_move(E) is ill-formed.
};
-} // namespace ranges::__iter_move
+} // namespace __iter_move
-namespace ranges::inline __cpo {
+inline namespace __cpo {
inline constexpr auto iter_move = __iter_move::__fn{};
-}
+} // namespace __cpo
+} // namespace ranges
template<__dereferenceable _Tp>
-requires requires(_Tp& __t) { { ranges::iter_move(__t) } -> __referenceable; }
+ requires requires(_Tp& __t) { { ranges::iter_move(__t) } -> __referenceable; }
using iter_rvalue_reference_t = decltype(ranges::iter_move(declval<_Tp&>()));
#endif // !_LIBCPP_HAS_NO_RANGES
diff --git a/libcxx/include/__iterator/iter_swap.h b/libcxx/include/__iterator/iter_swap.h
index a6c3bc8c663e3..d8fff5eb54999 100644
--- a/libcxx/include/__iterator/iter_swap.h
+++ b/libcxx/include/__iterator/iter_swap.h
@@ -28,6 +28,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#if !defined(_LIBCPP_HAS_NO_RANGES)
+// [iter.cust.swap]
+
namespace ranges {
namespace __iter_swap {
template<class _I1, class _I2>
@@ -79,12 +81,11 @@ namespace __iter_swap {
*_VSTD::forward<_T1>(__x) = _VSTD::move(__old);
}
};
-} // end namespace __iter_swap
+} // namespace __iter_swap
inline namespace __cpo {
inline constexpr auto iter_swap = __iter_swap::__fn{};
} // namespace __cpo
-
} // namespace ranges
template<class _I1, class _I2 = _I1>
diff --git a/libcxx/include/__ranges/enable_view.h b/libcxx/include/__ranges/enable_view.h
index e1daec046fc0c..70b2174e93e9d 100644
--- a/libcxx/include/__ranges/enable_view.h
+++ b/libcxx/include/__ranges/enable_view.h
@@ -38,7 +38,7 @@ template <class _Tp>
inline constexpr bool enable_view = derived_from<_Tp, view_base> ||
requires { ranges::__is_derived_from_view_interface((_Tp*)nullptr, (_Tp*)nullptr); };
-} // end namespace ranges
+} // namespace ranges
#endif // !_LIBCPP_HAS_NO_RANGES
More information about the libcxx-commits
mailing list