[libcxx-commits] [PATCH] D105205: [libcxx][ranges] implements dangling, borrowed_iterator_t, borrowed_subrange_t
Christopher Di Bella via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jul 8 14:15:51 PDT 2021
cjdb added inline comments.
================
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>;
----------------
ldionne wrote:
> zoecarver wrote:
> > 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).
> Agreed, I would just use
>
> ```
> template <class T>
> concept has_borrowed_iterator = requires {
> typename std::ranges::borrowed_iterator_t<T>;
> };
> ```
>
> That's closest to what we do in other tests, no?
Renamed, but keeping as `constexpr bool` (this is not a concept).
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