diff --git a/include/boost/container_hash/hash.hpp b/include/boost/container_hash/hash.hpp index b4066b1..f58c9c8 100644 --- a/include/boost/container_hash/hash.hpp +++ b/include/boost/container_hash/hash.hpp @@ -163,6 +163,20 @@ namespace boost typename boost::enable_if_::value, std::size_t>::type hash_value( T v ) { + // This should in principle return the equivalent of + // + // boost::hash_value( to_underlying(v) ); + // + // However, the C++03 implementation of underlying_type, + // + // conditional, make_signed, make_unsigned>::type::type + // + // generates a legitimate -Wconversion warning in is_signed, + // because -1 is not a valid enum value when all the enumerators + // are nonnegative. + // + // So the legacy implementation will have to do for now. + return static_cast( v ); }