[libcxx-commits] [PATCH] D123600: [libc++][ranges] Implement `views::take`.

Hui via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 19 12:40:30 PDT 2022


huixie90 added inline comments.


================
Comment at: libcxx/test/std/ranges/range.adaptors/range.take/adaptor.pass.cpp:51
+
+constexpr bool test() {
+  constexpr int N = 8;
----------------
var-const wrote:
> huixie90 wrote:
> > Could you add a test for 
> > > If decltype((F)) does not model convertible_­to<D>, views​::​take(E, F) is ill-formed
> This is checked by
> ```
>       static_assert(!CanBePiped<SomeView&,   decltype(std::views::take(/*n=*/NotAView{}))>);
> ```
> Would you prefer a more tailored test? (e.g. rather than having an empty type, come up with a more plausible number type that isn't convertible?)
ah. i didn't spot this particular line. I was looking at the lines that are checking `is_invocable_v<decltype(views::take), ...>` and didn't see something like `is_invocable_v<decltype(views::take), SomeView, NotADifference>`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123600



More information about the libcxx-commits mailing list