Ticket #4756: hash.diff

File hash.diff, 1.3 KB (added by ru.elric@…, 12 years ago)

Patch that resolves the issue.

  • boost/functional/hash/hash.hpp

     
    2424#include <boost/type_traits/is_pointer.hpp>
    2525#endif
    2626
     27#if !defined(BOOST_NO_0X_HDR_TYPEINDEX)
     28#include <typeindex>
     29#endif
     30
    2731#if BOOST_WORKAROUND(__GNUC__, < 3) \
    2832    && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
    2933#define BOOST_HASH_CHAR_TRAITS string_char_traits
     
    8791    std::size_t hash_value(
    8892        std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const&);
    8993
     94#if !defined(BOOST_NO_0X_HDR_TYPEINDEX)
     95    std::size_t hash_value(std::type_index const&);
     96#endif
     97
    9098    // Implementation
    9199
    92100    namespace hash_detail
     
    331339        return boost::hash_detail::float_hash_value(v);
    332340    }
    333341
     342#if !defined(BOOST_NO_0X_HDR_TYPEINDEX)
     343    inline std::size_t hash_value(std::type_index const& v)
     344    {
     345        return v.hash_code();
     346    }
     347#endif
     348
     349
    334350    //
    335351    // boost::hash
    336352    //
     
    435451    BOOST_HASH_SPECIALIZE(boost::ulong_long_type)
    436452#endif
    437453
     454#if !defined(BOOST_NO_0X_HDR_TYPEINDEX)
     455    BOOST_HASH_SPECIALIZE_REF(std::type_index)
     456#endif
     457
    438458#undef BOOST_HASH_SPECIALIZE
    439459#undef BOOST_HASH_SPECIALIZE_REF
    440460