[libcxx-commits] [libcxx] 9c52a19 - [libc++][NFC] Add namespace comments in ranges

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 1 09:19:56 PST 2022


Author: Nikolas Klauser
Date: 2022-02-01T18:18:13+01:00
New Revision: 9c52a19e32ae6cbc2507a3fe50c915d72a1c4394

URL: https://github.com/llvm/llvm-project/commit/9c52a19e32ae6cbc2507a3fe50c915d72a1c4394
DIFF: https://github.com/llvm/llvm-project/commit/9c52a19e32ae6cbc2507a3fe50c915d72a1c4394.diff

LOG: [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

Added: 
    

Modified: 
    libcxx/include/__functional/function.h
    libcxx/include/__ranges/access.h
    libcxx/include/__ranges/all.h
    libcxx/include/__ranges/common_view.h
    libcxx/include/__ranges/data.h
    libcxx/include/__ranges/empty.h
    libcxx/include/__ranges/iota_view.h
    libcxx/include/__ranges/reverse_view.h
    libcxx/include/__ranges/size.h
    libcxx/include/__ranges/transform_view.h
    libcxx/include/__ranges/view_interface.h
    libcxx/include/cstddef
    libcxx/include/variant

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h
index b6d383ce84591..6bb7eb7e8a246 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 _Rp>
 class _LIBCPP_TEMPLATE_VIS function<_Rp()>

diff  --git a/libcxx/include/__ranges/access.h b/libcxx/include/__ranges/access.h
index eb89c1a4b46d8..67c6c57bd81e4 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<const _Tp&&>(__t)))
       { return          ranges::begin(static_cast<const _Tp&&>(__t)); }
   };
-}
+} // namespace __cbegin
 
 inline namespace __cpo {
   inline constexpr auto cbegin = __cbegin::__fn{};
@@ -206,7 +206,7 @@ namespace __cend {
       -> decltype(      ranges::end(static_cast<const _Tp&&>(__t)))
       { return          ranges::end(static_cast<const _Tp&&>(__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 f1e78306d0492..b0a58e9bad82c 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 df401941740af..fb8078d65558e 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 2fd9929610793..f97ec80332976 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<const _Tp&&>(__t)))
       { return          ranges::data(static_cast<const _Tp&&>(__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 57762bfd1fcfb..b06a81c98e8fe 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 6e97873a8611a..17f6021f7dd4a 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 a2d856892942b..04ac7f29aa7cd 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 1c5081b6bd6a3..e1aaf7eba898e 100644
--- a/libcxx/include/__ranges/size.h
+++ b/libcxx/include/__ranges/size.h
@@ -29,7 +29,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 namespace ranges {
   template<class>
   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 9907753359fe3..d39dd40972905 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<decay_t<_Fn>, _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 674520c8e6d49..0a37323df8174 100644
--- a/libcxx/include/__ranges/view_interface.h
+++ b/libcxx/include/__ranges/view_interface.h
@@ -186,7 +186,7 @@ class view_interface {
   }
 };
 
-}
+} // namespace ranges
 
 #endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
 

diff  --git a/libcxx/include/cstddef b/libcxx/include/cstddef
index ed5aea6f7a19a..e77629e1ea0c6 100644
--- a/libcxx/include/cstddef
+++ b/libcxx/include/cstddef
@@ -156,7 +156,8 @@ template <class _Integer>
 template <class _Integer, class = _EnableByteOverload<_Integer> >
   _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 51bcd6ef4e98e..21fd53729d550 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -1252,7 +1252,7 @@ template <class _Tp, class... _Types>
 using __best_match_t =
     typename invoke_result_t<_MakeOverloads<_Types...>, _Tp, _Tp>::type;
 
-} // __variant_detail
+} // namespace __variant_detail
 
 template <class... _Types>
 class _LIBCPP_TEMPLATE_VIS variant


        


More information about the libcxx-commits mailing list