[libcxx-commits] [PATCH] D105205: [libcxx][ranges] implements dangling, borrowed_iterator_t, borrowed_subrange_t
Zoe Carver via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jul 1 10:11:42 PDT 2021
zoecarver accepted this revision as: zoecarver.
zoecarver added a comment.
A few nits. But LGTM.
================
Comment at: libcxx/include/ranges:98
+ requires (K == subrange_kind::sized || !sized_sentinel_for<S, I>)
+ class subrange;
+
----------------
Thanks.
================
Comment at: libcxx/include/ranges:101
+ template<class I, class S, subrange_kind K>
+ inline constexpr bool enable_borrowed_range<subrange<I, S, K>> = true;
+
----------------
Is this implemented? It doesn't look like it, yet.
================
Comment at: libcxx/test/std/ranges/range.utility/range.dangling/borrowed_iterator.compile.pass.cpp:32
+template <class T>
+constexpr bool has_type = requires {
+ typename std::ranges::borrowed_iterator_t<T>;
----------------
While you're at it (changing to a concept) can you rename this to something more descriptive? Maybe something like "hasIterator" or "validForBorrowedIter" or something that indicates you're checking the requirements (that T is a range).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D105205/new/
https://reviews.llvm.org/D105205
More information about the libcxx-commits
mailing list