[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:31:39 PDT 2021


jloser added inline comments.


================
Comment at: libcxx/include/span:195
 
+#if !defined(_LIBCPP_HAS_NO_RANGES)
+template <class _Range, class _ElementType>
----------------
ldionne wrote:
> This should be
> 
> ```
> #if _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_RANGES)
> ```
> 
> That way, once we drop support for compilers that don't implement concepts, we'll just get rid of ` && !defined(_LIBCPP_HAS_NO_RANGES)` entirely.
I changed it to that, but keep in mind p1394 is C++20 and not C++23. So, what do you think about

```
#if defined(__cpp_lib_concepts) && !defined(_LIBCPP_HAS_NO_RANGES)
```

instead? This will ensure concepts supports and >= C++20.


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