[libcxx-commits] [PATCH] D101193: [libcxx][ranges] Add ranges::empty CPO.

Tim Song via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 6 16:14:29 PDT 2021


tcanens added inline comments.


================
Comment at: libcxx/test/std/ranges/range.access/range.prim/empty.pass.cpp:25
+
+static_assert(!std::is_invocable_v<RangeEmptyT, int[]>);
+static_assert( std::is_invocable_v<RangeEmptyT, int[1]>);
----------------
cjdb wrote:
> tcanens wrote:
> > Quuxplusone wrote:
> > > Add:
> > > ```
> > > static_assert(!std::is_invocable_v<RangeEmptyT, int(&)[]>);
> > > static_assert(!std::is_invocable_v<RangeEmptyT, int(&&)[]>);
> > > ```
> > I'd suggest a test case for "array of unknown bound of incomplete type" (ideally for all the ranges CPOs). We spent a decent chunk of time in LWG pinning down what should happen for those.
> Like this? https://github.com/llvm/llvm-project/blob/main/libcxx/test/std/ranges/range.access/range.access.begin/incomplete.compile.verify.cpp
Yep. For `empty` and `size` it's simpler since those are supposed to be ill-formed DR.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101193



More information about the libcxx-commits mailing list