From 63955ffcc5129e5ad10a5f00c4d55a86852d7c54 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 16 May 2021 19:21:58 +0200 Subject: [PATCH] Avoid including ranges header under reflective-rapidjson's generator This works around errors which Clang 11.1.0 has when parsing this header from GCC 11.1.0. (Yes, at this point the GCC and Clang versions which are currently in Arch Linux testing are identical.) --- conversion/stringconversion.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/conversion/stringconversion.h b/conversion/stringconversion.h index 7de8585..26fa1e9 100644 --- a/conversion/stringconversion.h +++ b/conversion/stringconversion.h @@ -18,7 +18,10 @@ #include #include -#if __cplusplus >= 201709 +#if __cplusplus >= 201709 && !defined(REFLECTIVE_RAPIDJSON_GENERATOR) +#ifndef CPP_UTILITIES_USE_RANGES +#define CPP_UTILITIES_USE_RANGES +#endif #include #endif @@ -65,7 +68,7 @@ CPP_UTILITIES_EXPORT void truncateString(std::string &str, char terminationChar /// \cond namespace Detail { -#if __cplusplus >= 201709 +#ifdef CPP_UTILITIES_USE_RANGES template using ContainerValueType = typename std::conditional_t, std::iterator_traits>>, Container>::value_type;