[libcxx-commits] [PATCH] D117918: [libc++][test] Add const and reference tests for enable_view

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 21 12:30:14 PST 2022


philnik added inline comments.


================
Comment at: libcxx/test/std/ranges/range.req/range.view/enable_view.compile.pass.cpp:42
 struct EnableViewFalse : std::ranges::view_base { };
 namespace std::ranges { template <> constexpr bool enable_view<EnableViewFalse> = false; }
 static_assert(!std::ranges::enable_view<EnableViewFalse>);
----------------



================
Comment at: libcxx/test/std/ranges/range.req/range.view/enable_view.compile.pass.cpp:46
+static_assert(!std::ranges::enable_view<EnableViewFalse&&>);
+static_assert(std::ranges::enable_view<const EnableViewFalse>);
+static_assert(!std::ranges::enable_view<const EnableViewFalse&>);
----------------
This seems weird. It looks to me like the standard requires it that way, but I don't know why.


================
Comment at: libcxx/test/std/ranges/range.req/range.view/enable_view.compile.pass.cpp:61
 struct EnableViewTrue { };
 namespace std::ranges { template <> constexpr bool enable_view<EnableViewTrue> = true; }
 static_assert(std::ranges::enable_view<EnableViewTrue>);
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117918



More information about the libcxx-commits mailing list