mirror of
https://github.com/boostorg/callable_traits.git
synced 2026-02-20 14:42:14 +00:00
enabling older versions of libstdc++
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user