From c381b35ee671a9175a70348199da55f2f782ef43 Mon Sep 17 00:00:00 2001 From: badair Date: Tue, 29 Mar 2016 21:27:32 -0500 Subject: [PATCH] enabling older versions of libstdc++ --- include/callable_traits/config.hpp | 9 +++++++++ include/callable_traits/detail/any_arg.hpp | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/callable_traits/config.hpp b/include/callable_traits/config.hpp index 65bfafd..b97d745 100644 --- a/include/callable_traits/config.hpp +++ b/include/callable_traits/config.hpp @@ -23,6 +23,15 @@ Distributed under the Boost Software License, Version 1.0. #endif //ifndef __clang__ #endif //_MSC_VER +//libstdc++ formerly used this non-conforming trait +#if defined(__GLIBCXX__) && __GLIBCXX__ < 20150422 +#define CALLABLE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE(T) \ + std::has_trivial_default_constructor::value +#else +#define CALLABLE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE(T) \ + std::is_trivially_default_constructible::value +#endif //if defined(__GLIBCXX__) && __GLIBCXX__ < 20150422 + #include namespace callable_traits { diff --git a/include/callable_traits/detail/any_arg.hpp b/include/callable_traits/detail/any_arg.hpp index d79c6b9..3fb2bd1 100644 --- a/include/callable_traits/detail/any_arg.hpp +++ b/include/callable_traits/detail/any_arg.hpp @@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0. #include #include +#include namespace callable_traits { @@ -40,7 +41,7 @@ namespace callable_traits { template> using int_if_trivial = typename std::enable_if< - std::is_trivially_default_constructible::value, + CALLABLE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE(U), T >::type;