From 33d7985c8b63d90bba4f7a8de8ee41f7269cbd48 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Tue, 3 Jul 2012 20:58:03 +0400 Subject: [PATCH] Optimized hash_code() --- boost/type_index.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/boost/type_index.hpp b/boost/type_index.hpp index 3e07992..eee44b4 100644 --- a/boost/type_index.hpp +++ b/boost/type_index.hpp @@ -393,8 +393,12 @@ public: #endif // BOOST_TYPE_INDEX_DOXYGEN_INVOKED /// Function for getting hash value - std::size_t hash_code() const { + std::size_t hash_code() const BOOST_CLASSINFO_COMPARISON_NOEXCEPT { +#if _MSC_VER >= 1600 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5 && defined(__GXX_EXPERIMENTAL_CXX0X__)) + return pinfo_->hash_code(); +#else return boost::hash_range(name(), name() + std::strlen(name())); +#endif } };