[libcxx-commits] [PATCH] D108047: [libcxx][ranges] Move `namespace views` into `namespace ranges` and add an alias.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 13 12:53:38 PDT 2021


Quuxplusone accepted this revision.
Quuxplusone added inline comments.
This revision is now accepted and ready to land.


================
Comment at: libcxx/include/__ranges/all.h:35-36
 
+namespace ranges {
 namespace views {
 
----------------
Any appetite for `namespace ranges::views {` here? I have a slight preference for it, but won't push hard for it right now.


================
Comment at: libcxx/test/std/ranges/range.adaptors/range.all/all.pass.cpp:88
   {
-    ASSERT_SAME_TYPE(decltype(std::views::all(View<true>())), View<true>);
-    static_assert(noexcept(std::views::all(View<true>())));
-    static_assert(!noexcept(std::views::all(View<false>())));
+    ASSERT_SAME_TYPE(decltype(std::ranges::views::all(View<true>())), View<true>);
+    static_assert(noexcept(std::ranges::views::all(View<true>())));
----------------
zoecarver wrote:
> Intentionally testing this inconsistently so that we cover both `std::ranges::views` and `std::views`.
I don't particularly object, because I probably wouldn't have noticed if the test had been committed this way to begin with. But if you want to test that `std::views` is the same as `std::ranges::views`, the right place for that test is not semi-accidentally inside `all.pass.cpp`; it may deserve a dedicated test file.
(However, IMHO it also //doesn't// need a test of its own, because it's super obvious.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108047/new/

https://reviews.llvm.org/D108047



More information about the libcxx-commits mailing list