gcc < 7 doesn't like specializing std::hash in a different namespace

This commit is contained in:
Peter Dimov
2020-01-11 05:27:57 +02:00
parent be11d94adc
commit b3229d48b7

View File

@ -1855,18 +1855,23 @@ template<class V> struct std_hash_impl<V, true>
} // namespace variant2
} // namespace boost
template<class... T> struct std::hash< boost::variant2::variant<T...> >: public boost::variant2::detail::std_hash_impl< boost::variant2::variant<T...> >
namespace std
{
template<class... T> struct hash< ::boost::variant2::variant<T...> >: public ::boost::variant2::detail::std_hash_impl< ::boost::variant2::variant<T...> >
{
};
template<> struct std::hash< boost::variant2::monostate >
template<> struct hash< ::boost::variant2::monostate >
{
std::size_t operator()( boost::variant2::monostate const & v ) const
std::size_t operator()( ::boost::variant2::monostate const & v ) const
{
return hash_value( v );
}
};
} // namespace std
#if defined(_MSC_VER) && _MSC_VER < 1910
# pragma warning( pop )
#endif