[libcxx-commits] [PATCH] D106840: [libcxx][ranges] Add `std::ranges::single_view`.

Christopher Di Bella via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 28 09:13:47 PDT 2021


cjdb added inline comments.


================
Comment at: libcxx/include/__ranges/single_view.h:1
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
----------------
ldionne wrote:
> Could you add `views::single` at the same time? It's pretty small so it makes sense to implement both in the same go, I think.
> 
> Also, this makes me think that we don't have `views::empty`, right?
If you're going to take @ldionne up on this (and I think you should), please DM me so we can discuss a cohesive design for the adaptor closures. I don't want us to have wildly different ideas about what goes in this namespace.


================
Comment at: libcxx/test/std/ranges/range.factories/range.single.view/size.pass.cpp:13
+
+// static constexpr size_t size() noexcept;
+
----------------
ldionne wrote:
> Since the spec documents this as being `static`, can you add a test that `std::ranges::single_view<int>::size()` works as well?
Unless there are already tests in `ranges::size` for static members, is it worth adding a test here for `ranges::size` too?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106840



More information about the libcxx-commits mailing list