From 0068f6c0fda6b270c9e7481a17a7d0556be15f60 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 19 Oct 2023 00:00:41 -0400 Subject: [PATCH 1/2] build: concept carveout for clang + std::copyable --- include/xo/randomgen/distribution_concept.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/xo/randomgen/distribution_concept.hpp b/include/xo/randomgen/distribution_concept.hpp index 61c764e0..979a64d5 100644 --- a/include/xo/randomgen/distribution_concept.hpp +++ b/include/xo/randomgen/distribution_concept.hpp @@ -24,12 +24,16 @@ namespace xo { // os << dist // is >> dist - } && std::copyable + } +#ifdef __clang__ + // std::copyable apparently not available in clang11 ? +#else + && std::copyable && std::copyable +#endif && std::equality_comparable; } /*namespace rng*/ } /*namespace xo*/ - /* end distribution_concept.hpp */ From a6d0252dd46c19772370fab8e752c15497f0ca64 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Thu, 19 Oct 2023 12:15:18 -0400 Subject: [PATCH 2/2] build: clang16 fixes (c++20 concept headers available) --- include/xo/randomgen/distribution_concept.hpp | 3 ++- include/xo/randomgen/engine_concept.hpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/xo/randomgen/distribution_concept.hpp b/include/xo/randomgen/distribution_concept.hpp index 979a64d5..c2343255 100644 --- a/include/xo/randomgen/distribution_concept.hpp +++ b/include/xo/randomgen/distribution_concept.hpp @@ -30,8 +30,9 @@ namespace xo { #else && std::copyable && std::copyable + && std::equality_comparable #endif - && std::equality_comparable; + ; } /*namespace rng*/ } /*namespace xo*/ diff --git a/include/xo/randomgen/engine_concept.hpp b/include/xo/randomgen/engine_concept.hpp index 38b65cd7..2b3a2e53 100644 --- a/include/xo/randomgen/engine_concept.hpp +++ b/include/xo/randomgen/engine_concept.hpp @@ -7,6 +7,8 @@ namespace std { #ifdef __clang__ + +# if __clang_major__ <= 11 template < class T > concept integral = std::is_integral_v; @@ -31,8 +33,11 @@ namespace std { && requires { { G::min() } -> std::same_as>; { G::max() } -> std::same_as>; requires std::bool_constant<(G::min() < G::max())>::value; }; +# endif + #else /* uniform_random_bit_generator provided by gcc 12.3.2 */ + /* uniform_random_bit_generator provided by clang 16 */ #endif } /*namespace std*/