enabling older versions of libstdc++

This commit is contained in:
badair
2016-03-29 21:27:32 -05:00
parent cd11e2983c
commit c381b35ee6
2 changed files with 11 additions and 1 deletions

View File

@@ -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<T>::value
#else
#define CALLABLE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE(T) \
std::is_trivially_default_constructible<T>::value
#endif //if defined(__GLIBCXX__) && __GLIBCXX__ < 20150422
#include <utility>
namespace callable_traits {

View File

@@ -12,6 +12,7 @@ Distributed under the Boost Software License, Version 1.0.
#include <utility>
#include <callable_traits/detail/make_constexpr.hpp>
#include <callable_traits/config.hpp>
namespace callable_traits {
@@ -40,7 +41,7 @@ namespace callable_traits {
template<typename T, typename U = shallow_decay<T>>
using int_if_trivial =
typename std::enable_if<
std::is_trivially_default_constructible<U>::value,
CALLABLE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE(U),
T
>::type;