[libcxx-commits] [PATCH] D142063: [libc++][ranges] implement `std::ranges::split_view` (WIP on testing, targeting llvm 16)

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 19 20:57:56 PST 2023


philnik added inline comments.


================
Comment at: libcxx/include/__ranges/split_view.h:200
+  template <class _Range, class _Pattern>
+  [[nodiscard]] _LIBCPP_HIDE_FROM_ABI
+  constexpr auto operator()(_Range&& __range, _Pattern&& __pattern) const
----------------
var-const wrote:
> philnik wrote:
> > same for the other one.
> @philnik We've been doing it this way for many (perhaps all) other views, should we change the others as well?
I think so, since it's an extension. I think we used `[[nodiscard]]` before because we wanted the extension for most users, but back then we didn't enable the `[[nodiscard]]` extensions by default. Now we do, so we can just say "don't disable the extension if you want it".

Looking through the views, it seems like we use `[[nodiscard]]` on views, and didn't declare `views::iota`, `views::istream` and `views::zip` with any `[[nodiscard]]` version.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142063



More information about the libcxx-commits mailing list