6 #if defined(OPENTELEMETRY_STL_VERSION)
7 # if OPENTELEMETRY_STL_VERSION >= 2011
8 # include "opentelemetry/std/type_traits.h"
9 # define OPENTELEMETRY_HAVE_STD_TYPE_TRAITS
13 #include <type_traits>
15 #if !defined(OPENTELEMETRY_HAVE_STD_TYPE_TRAITS)
18 # include "opentelemetry/nostd/detail/void.h"
19 # include "opentelemetry/version.h"
22 #if !defined(__GLIBCXX__) || (defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 7) || \
23 (defined(__GLIBCXX__) && __GLIBCXX__ >= 20150422) // >= libstdc++-5
24 # define OPENTELEMETRY_TRIVIALITY_TYPE_TRAITS
39 template <
bool B,
class T =
void>
40 using enable_if_t =
typename std::enable_if<B, T>::type;
58 using remove_cvref_t =
typename std::remove_cv<remove_reference_t<T>>::type;
64 struct remove_all_extents
69 template <
typename T, std::
size_t N>
79 #if defined(OPENTELEMETRY_STL_VERSION) && OPENTELEMETRY_STL_VERSION >= 2017
81 using std::is_swappable;
97 template <typename U, typename = decltype(swap(std::declval<U &>(), std::declval<U &>()))>
100 template <
typename U>
104 static constexpr
bool value = decltype(test<T>(0))::
value;
110 using detail::swappable::is_swappable;
119 template <
bool IsSwappable,
typename T>
122 static constexpr
bool value = noexcept(
swap(std::declval<T &>(), std::declval<T &>()));
125 template <
typename T>
130 template <
typename T>
141 #ifdef OPENTELEMETRY_TRIVIALITY_TYPE_TRAITS
142 using std::is_trivially_copy_assignable;
143 using std::is_trivially_copy_constructible;
144 using std::is_trivially_move_assignable;
145 using std::is_trivially_move_constructible;
147 template <
typename T>
148 struct is_trivially_copy_constructible
150 static constexpr
bool value = std::is_copy_constructible<T>::value && __has_trivial_copy(T);
153 template <
typename T>
154 struct is_trivially_move_constructible
156 static constexpr
bool value = __is_trivial(T);
159 template <
typename T>
160 struct is_trivially_copy_assignable
162 static constexpr
bool value = std::is_copy_assignable<T>::value && __has_trivial_assign(T);
165 template <
typename T>
166 struct is_trivially_move_assignable
168 static constexpr
bool value = __is_trivial(T);