[libcxx-commits] [PATCH] D110503: [libc++] Implement P1394r4 for span: range constructor

Joe Loser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 27 17:31:50 PDT 2021


jloser added inline comments.


================
Comment at: libcxx/test/std/containers/views/span.cons/simple_range.h:4
+template <class T, size_t Size>
+struct SimpleRange {
+    constexpr T *data() {
----------------
Quuxplusone wrote:
> Once you convert `range.fail.cpp` to a bunch of static_asserts, you'll be using `SimpleRange` in only one file, and then it won't need its own header, so this comment will be moot.
> 
> If this class isn't scoped to a single test, then it should have a descriptive name like `SimpleContiguousNonborrowedRange`... which is just `std::vector`, isn't it? What's the point of making our own type here at all?
Its new use in `range.pass.cpp` will be that we can have our `test()` function be usable in a `constexpr` context since `std::vector` isn't fully `constexpr` yet.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110503



More information about the libcxx-commits mailing list