[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 16:29:32 PDT 2021
jloser added inline comments.
================
Comment at: libcxx/include/span:196
+template <class _Range, class _ElementType>
+inline constexpr bool __is_range_compatible =
+ ranges::contiguous_range<_Range> &&
----------------
Quuxplusone wrote:
> If we're assuming Ranges+Concepts support (`contiguous_range`), then we can use `concept` instead of `inline constexpr bool`, and make things maybe very slightly easier on the compiler. However, I'm not sure that we //can// assume Concepts support; don't we need some #ifdef guards sprinkled through here? Ditto on the deduction guides that use `ranges::` things.
>
>
>
> Also, the name of this should be something like `__is_span_compatible_range`; remember this is directly in namespace `_VSTD` along with everything else in the library, so its name shouldn't be too generic.
Renamed to `__is_span_compatible_range`.
Talked with Louis on Discord and we decided we can assume ranges + concepts support. This will fail on CI for AppleClang 12.0 which we're dropping support for soon since AppleClang 13.0 just came out on 9/20. As such, made `__is_span_compatible_range` a concept which allows me to use terse syntax below in those constructors rather than `enable_if_t<...>`.
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