Fix build with C++20 on macOS

The macOS standard library doesn't have std::contiguous_iterator yet, and
it doesn't seem like libc++ has it either.
Checking __cpp_lib_concepts for the C++20 official version appears to work.

Pick-to: 6.3 6.2
Change-Id: I8c31cd64de24c03b3a3f37cb393bb2f9b55a834d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2022-02-05 14:40:53 +01:00
parent a0d1f6b5aa
commit c0af004d74

View File

@ -37,7 +37,7 @@
#if __cplusplus >= 202002L && (!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE >= 11)
# if __has_include(<concepts>)
# include <concepts>
# if defined(__cpp_concepts)
# if defined(__cpp_lib_concepts) && __cpp_lib_concepts >= 202002L
static_assert(std::contiguous_iterator<QList<int>::iterator>);
static_assert(std::contiguous_iterator<QList<int>::const_iterator>);
# endif