Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

Commit

Permalink
mdbx++: disable using C++20 concepts for CLANG < 12.
Browse files Browse the repository at this point in the history
  • Loading branch information
erthink committed Jul 26, 2021
1 parent a9e9924 commit a811526
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions mdbx.h++
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,19 @@
#endif /* MDBX_CXX20_UNLIKELY */

#ifndef MDBX_CXX20_CONCEPT
#if defined(DOXYGEN) || (defined(__cpp_concepts) && __cpp_concepts >= 201907L)
#if defined(DOXYGEN) || \
(defined(__cpp_concepts) && __cpp_concepts >= 201907L && \
(!defined(__clang__) || __clang_major__ >= 12))
#define MDBX_CXX20_CONCEPT(CONCEPT, NAME) CONCEPT NAME
#else
#define MDBX_CXX20_CONCEPT(CONCEPT, NAME) typename NAME
#endif
#endif /* MDBX_CXX20_CONCEPT */

#ifndef MDBX_ASSERT_CXX20_CONCEPT_SATISFIED
#if defined(DOXYGEN) || (defined(__cpp_concepts) && __cpp_concepts >= 201907L)
#if defined(DOXYGEN) || \
(defined(__cpp_concepts) && __cpp_concepts >= 201907L && \
(!defined(__clang__) || __clang_major__ >= 12))
#define MDBX_ASSERT_CXX20_CONCEPT_SATISFIED(CONCEPT, TYPE) \
static_assert(CONCEPT<TYPE>)
#else
Expand Down Expand Up @@ -466,7 +470,9 @@ static MDBX_CXX20_CONSTEXPR void *memcpy(void *dest, const void *src,
size_t bytes) noexcept;
//------------------------------------------------------------------------------

#if defined(DOXYGEN) || (defined(__cpp_concepts) && __cpp_concepts >= 201907L)
#if defined(DOXYGEN) || \
(defined(__cpp_concepts) && __cpp_concepts >= 201907L && \
(!defined(__clang__) || __clang_major__ >= 12))

template <typename T>
concept MutableByteProducer = requires(T a, char array[42]) {
Expand Down

0 comments on commit a811526

Please sign in to comment.