From 9c52a19e32ae6cbc2507a3fe50c915d72a1c4394 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Tue, 1 Feb 2022 18:11:49 +0100 Subject: [PATCH] [libc++][NFC] Add namespace comments in ranges With this patch there should be no more namespaces without closing comment Reviewed By: ldionne, Quuxplusone, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D118668 --- libcxx/include/__functional/function.h | 2 +- libcxx/include/__ranges/access.h | 8 ++++---- libcxx/include/__ranges/all.h | 2 +- libcxx/include/__ranges/common_view.h | 4 ++-- libcxx/include/__ranges/data.h | 4 ++-- libcxx/include/__ranges/empty.h | 2 +- libcxx/include/__ranges/iota_view.h | 2 +- libcxx/include/__ranges/reverse_view.h | 4 ++-- libcxx/include/__ranges/size.h | 6 +++--- libcxx/include/__ranges/transform_view.h | 4 ++-- libcxx/include/__ranges/view_interface.h | 2 +- libcxx/include/cstddef | 3 ++- libcxx/include/variant | 2 +- 13 files changed, 23 insertions(+), 22 deletions(-) diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h index b6d383c..6bb7eb7 100644 --- a/libcxx/include/__functional/function.h +++ b/libcxx/include/__functional/function.h @@ -1664,7 +1664,7 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target_type() const #endif // _LIBCPP_NO_RTTI -} // __function +} // namespace __function template class _LIBCPP_TEMPLATE_VIS function<_Rp()> diff --git a/libcxx/include/__ranges/access.h b/libcxx/include/__ranges/access.h index eb89c1a..67c6c57 100644 --- a/libcxx/include/__ranges/access.h +++ b/libcxx/include/__ranges/access.h @@ -83,7 +83,7 @@ namespace __begin { void operator()(auto&&) const = delete; }; -} +} // namespace __begin inline namespace __cpo { inline constexpr auto begin = __begin::__fn{}; @@ -150,7 +150,7 @@ namespace __end { void operator()(auto&&) const = delete; }; -} +} // namespace __end inline namespace __cpo { inline constexpr auto end = __end::__fn{}; @@ -178,7 +178,7 @@ namespace __cbegin { -> decltype( ranges::begin(static_cast(__t))) { return ranges::begin(static_cast(__t)); } }; -} +} // namespace __cbegin inline namespace __cpo { inline constexpr auto cbegin = __cbegin::__fn{}; @@ -206,7 +206,7 @@ namespace __cend { -> decltype( ranges::end(static_cast(__t))) { return ranges::end(static_cast(__t)); } }; -} +} // namespace __cend inline namespace __cpo { inline constexpr auto cend = __cend::__fn{}; diff --git a/libcxx/include/__ranges/all.h b/libcxx/include/__ranges/all.h index f1e7830..b0a58e9 100644 --- a/libcxx/include/__ranges/all.h +++ b/libcxx/include/__ranges/all.h @@ -64,7 +64,7 @@ namespace __all { return ranges::owning_view{_VSTD::forward<_Tp>(__t)}; } }; -} +} // namespace __all inline namespace __cpo { inline constexpr auto all = __all::__fn{}; diff --git a/libcxx/include/__ranges/common_view.h b/libcxx/include/__ranges/common_view.h index df40194..fb8078d 100644 --- a/libcxx/include/__ranges/common_view.h +++ b/libcxx/include/__ranges/common_view.h @@ -120,11 +120,11 @@ namespace __common { -> decltype( common_view{_VSTD::forward<_Range>(__range)}) { return common_view{_VSTD::forward<_Range>(__range)}; } }; -} +} // namespace __common inline namespace __cpo { inline constexpr auto common = __common::__fn{}; -} +} // namespace __cpo } // namespace views } // namespace ranges diff --git a/libcxx/include/__ranges/data.h b/libcxx/include/__ranges/data.h index 2fd9929..f97ec80 100644 --- a/libcxx/include/__ranges/data.h +++ b/libcxx/include/__ranges/data.h @@ -64,7 +64,7 @@ namespace __data { return _VSTD::to_address(ranges::begin(__t)); } }; -} +} // namespace __data inline namespace __cpo { inline constexpr auto data = __data::__fn{}; @@ -92,7 +92,7 @@ namespace __cdata { -> decltype( ranges::data(static_cast(__t))) { return ranges::data(static_cast(__t)); } }; -} +} // namespace __cdata inline namespace __cpo { inline constexpr auto cdata = __cdata::__fn{}; diff --git a/libcxx/include/__ranges/empty.h b/libcxx/include/__ranges/empty.h index 57762bf..b06a81c 100644 --- a/libcxx/include/__ranges/empty.h +++ b/libcxx/include/__ranges/empty.h @@ -68,7 +68,7 @@ namespace __empty { return ranges::begin(__t) == ranges::end(__t); } }; -} +} // namespace __empty inline namespace __cpo { inline constexpr auto empty = __empty::__fn{}; diff --git a/libcxx/include/__ranges/iota_view.h b/libcxx/include/__ranges/iota_view.h index 6e97873..17f6021 100644 --- a/libcxx/include/__ranges/iota_view.h +++ b/libcxx/include/__ranges/iota_view.h @@ -397,7 +397,7 @@ namespace __iota { inline namespace __cpo { inline constexpr auto iota = __iota::__fn{}; -} +} // namespace __cpo } // namespace views } // namespace ranges diff --git a/libcxx/include/__ranges/reverse_view.h b/libcxx/include/__ranges/reverse_view.h index a2d8568..04ac7f2 100644 --- a/libcxx/include/__ranges/reverse_view.h +++ b/libcxx/include/__ranges/reverse_view.h @@ -175,11 +175,11 @@ namespace ranges { -> decltype( reverse_view{_VSTD::forward<_Range>(__range)}) { return reverse_view{_VSTD::forward<_Range>(__range)}; } }; - } + } // namespace __reverse inline namespace __cpo { inline constexpr auto reverse = __reverse::__fn{}; - } + } // namespace __cpo } // namespace views } // namespace ranges diff --git a/libcxx/include/__ranges/size.h b/libcxx/include/__ranges/size.h index 1c5081b..e1aaf7e 100644 --- a/libcxx/include/__ranges/size.h +++ b/libcxx/include/__ranges/size.h @@ -29,7 +29,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD namespace ranges { template inline constexpr bool disable_sized_range = false; -} +} // namespace ranges // [range.prim.size] @@ -97,7 +97,7 @@ namespace __size { return _VSTD::__to_unsigned_like(ranges::end(__t) - ranges::begin(__t)); } }; -} +} // namespace __size inline namespace __cpo { inline constexpr auto size = __size::__fn{}; @@ -121,7 +121,7 @@ namespace __ssize { return static_cast<_Signed>(ranges::size(__t)); } }; -} +} // namespace __ssize inline namespace __cpo { inline constexpr auto ssize = __ssize::__fn{}; diff --git a/libcxx/include/__ranges/transform_view.h b/libcxx/include/__ranges/transform_view.h index 9907753..d39dd409 100644 --- a/libcxx/include/__ranges/transform_view.h +++ b/libcxx/include/__ranges/transform_view.h @@ -424,11 +424,11 @@ namespace __transform { noexcept(is_nothrow_constructible_v, _Fn>) { return __range_adaptor_closure_t(_VSTD::__bind_back(*this, _VSTD::forward<_Fn>(__f))); } }; -} +} // namespace __transform inline namespace __cpo { inline constexpr auto transform = __transform::__fn{}; -} +} // namespace __cpo } // namespace views } // namespace ranges diff --git a/libcxx/include/__ranges/view_interface.h b/libcxx/include/__ranges/view_interface.h index 674520c..0a37323 100644 --- a/libcxx/include/__ranges/view_interface.h +++ b/libcxx/include/__ranges/view_interface.h @@ -186,7 +186,7 @@ public: } }; -} +} // namespace ranges #endif // !defined(_LIBCPP_HAS_NO_CONCEPTS) diff --git a/libcxx/include/cstddef b/libcxx/include/cstddef index ed5aea6..e77629e 100644 --- a/libcxx/include/cstddef +++ b/libcxx/include/cstddef @@ -156,7 +156,8 @@ template template > _LIBCPP_NODISCARD_EXT constexpr _Integer to_integer(byte __b) noexcept { return static_cast<_Integer>(__b); } -} + +} // namespace std #endif diff --git a/libcxx/include/variant b/libcxx/include/variant index 51bcd6e..21fd537 100644 --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -1252,7 +1252,7 @@ template using __best_match_t = typename invoke_result_t<_MakeOverloads<_Types...>, _Tp, _Tp>::type; -} // __variant_detail +} // namespace __variant_detail template class _LIBCPP_TEMPLATE_VIS variant -- 2.7.4