diff --git a/src/maybe.h b/src/maybe.h index 4b7de55cc..236c4bf04 100644 --- a/src/maybe.h +++ b/src/maybe.h @@ -147,10 +147,14 @@ inline constexpr none_t none() { return none_t::none; } // This is a value-type class that stores a value of T in aligned storage. template class maybe_t : private maybe_detail::conditionally_copyable_t { +#if __GNUG__ && __GNUC__ < 5 + using maybe_impl_t = maybe_detail::maybe_impl_not_trivially_copyable_t; +#else using maybe_impl_t = typename std::conditional::value, maybe_detail::maybe_impl_trivially_copyable_t, - maybe_detail::maybe_impl_not_trivially_copyable_t>::type; + maybe_detail::maybe_impl_not_trivially_copyable_t >::type; +#endif maybe_impl_t impl_; public: