From 11dd63d9e3f4a129c84caa58791d0cde1622586b Mon Sep 17 00:00:00 2001 From: Andrea Iob Date: Fri, 7 Jun 2024 11:43:37 +0200 Subject: [PATCH] common: add a custom implementation of std::void_t for C++11 backwards compatibility --- src/common/compiler.hpp | 20 ++++++++++++++++++++ src/discretization/stencil_weight.hpp | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/common/compiler.hpp b/src/common/compiler.hpp index 40f03a4255..ef1a171ff5 100644 --- a/src/common/compiler.hpp +++ b/src/common/compiler.hpp @@ -96,4 +96,24 @@ do { \ */ #define BITPIT_COMMA , + +/*! + * \ingroup common_misc + * + * Custom implementation of std::void_t for C++11 backwards compatibility. + */ +#if __cplusplus < 201703L +template +struct make_void { using type = void; }; + +template +using void_t = typename make_void::type; + +template +using bitpit_void_t = void_t; +#else +template +using bitpit_void_t = std::void_t; +#endif + #endif diff --git a/src/discretization/stencil_weight.hpp b/src/discretization/stencil_weight.hpp index 75398de2ea..4de16ebb95 100644 --- a/src/discretization/stencil_weight.hpp +++ b/src/discretization/stencil_weight.hpp @@ -67,7 +67,7 @@ class DiscreteStencilWeightValueInfo }; template -class DiscreteStencilWeightValueInfo> +class DiscreteStencilWeightValueInfo> { public: using type = typename weight_t::value_type;