From be74716251a651c71dd6ef78ff90ff513091daa0 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Thu, 18 May 2017 22:50:25 +0300 Subject: [PATCH] Use native hash_code() when possible on GCC-like compilers --- include/boost/type_index/stl_type_index.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/boost/type_index/stl_type_index.hpp b/include/boost/type_index/stl_type_index.hpp index 2b06368..dcc532d 100644 --- a/include/boost/type_index/stl_type_index.hpp +++ b/include/boost/type_index/stl_type_index.hpp @@ -40,7 +40,9 @@ #include #include -#if !((defined(_MSC_VER) && _MSC_VER > 1600) || (__GNUC__ == 4 && __GNUC_MINOR__ > 5 && defined(__GXX_EXPERIMENTAL_CXX0X__))) +#if !((defined(_MSC_VER) && _MSC_VER > 1600) \ + || (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ > 5 && defined(__GXX_EXPERIMENTAL_CXX0X__)) \ + || (defined(__GNUC__) && __GNUC__ > 4 && __cplusplus >= 201103 )) # include #endif @@ -178,7 +180,9 @@ inline std::string stl_type_index::pretty_name() const { inline std::size_t stl_type_index::hash_code() const BOOST_NOEXCEPT { -#if (defined(_MSC_VER) && _MSC_VER > 1600) || (__GNUC__ == 4 && __GNUC_MINOR__ > 5 && defined(__GXX_EXPERIMENTAL_CXX0X__)) +#if (defined(_MSC_VER) && _MSC_VER > 1600) \ + || (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ > 5 && defined(__GXX_EXPERIMENTAL_CXX0X__)) \ + || (defined(__GNUC__) && __GNUC__ > 4 && __cplusplus >= 201103) return data_->hash_code(); #else return boost::hash_range(raw_name(), raw_name() + std::strlen(raw_name()));