mpark / variant

C++17 `std::variant` for C++11/14/17
https://mpark.github.io/variant
Boost Software License 1.0
664 stars 87 forks source link

Add workaround for libstdc++ < 5.0 #8

Closed gnzlbg closed 7 years ago

gnzlbg commented 8 years ago

libstdc++ < 5.0 doesn't provide std::is_trivially_copyable but the old proposed type traits. The following workaround can be added to support libstdc++ < 5.0

#if defined(__GLIBCXX__) && __GLIBCXX__ < 20150801
namespace std {
template <typename T>
struct is_trivially_copyable : integral_constant<bool, __has_trivial_copy(T)> {
};
}  // namespace std
#endif  // GLIBCXX macro
mpark commented 7 years ago

Closing this as is_trivially_copyable is no longer used.