diff --git a/libstdc++-v3/include/bits/functional_hash.h b/libstdc++-v3/include/bits/functional_hash.h index c00113eff83..292c0ee03f7 100644 --- a/libstdc++-v3/include/bits/functional_hash.h +++ b/libstdc++-v3/include/bits/functional_hash.h @@ -280,10 +280,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// @} group hashes - // Hint about performance of hash functor. If not fast the hash-based - // containers will cache the hash code. - // Default behavior is to consider that hashers are fast unless specified - // otherwise. + /** Hint about performance of hash functions. + * + * If a given hash function object is not fast, the hash-based containers + * will cache the hash code. + * The default behavior is to consider that hashers are fast unless specified + * otherwise. + * + * Users can specialize this for their own hash functions in order to force + * caching of hash codes in unordered containers. Specializing this trait + * affects the ABI of the unordered containers, so use it carefully. + */ template struct __is_fast_hash : public std::true_type { }; diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h index edc151ef15b..29ec1192f32 100644 --- a/libstdc++-v3/include/bits/hashtable.h +++ b/libstdc++-v3/include/bits/hashtable.h @@ -34,11 +34,10 @@ #include #include +#include // __has_is_transparent_t #if __cplusplus > 201402L # include #endif -#include -#include // equal_to, _Identity, _Select1st namespace std _GLIBCXX_VISIBILITY(default) { diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h index 799c3e986b4..1a259702f98 100644 --- a/libstdc++-v3/include/bits/hashtable_policy.h +++ b/libstdc++-v3/include/bits/hashtable_policy.h @@ -32,7 +32,9 @@ #define _HASHTABLE_POLICY_H 1 #include // for std::tuple, std::forward_as_tuple +#include // for __is_fast_hash #include // for std::min, std::is_permutation. +#include // for std::pair #include // for __gnu_cxx::__aligned_buffer #include // for std::__alloc_rebind #include // for __gnu_cxx::__int_traits diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h index d5edfde8caf..5a3e6f61af2 100644 --- a/libstdc++-v3/include/bits/unordered_map.h +++ b/libstdc++-v3/include/bits/unordered_map.h @@ -30,6 +30,11 @@ #ifndef _UNORDERED_MAP_H #define _UNORDERED_MAP_H +#include +#include +#include // hash +#include // equal_to + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION diff --git a/libstdc++-v3/include/bits/unordered_set.h b/libstdc++-v3/include/bits/unordered_set.h index d2fa2c51171..740bbafd4c9 100644 --- a/libstdc++-v3/include/bits/unordered_set.h +++ b/libstdc++-v3/include/bits/unordered_set.h @@ -30,6 +30,11 @@ #ifndef _UNORDERED_SET_H #define _UNORDERED_SET_H +#include +#include +#include // hash +#include // equal_to + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION diff --git a/libstdc++-v3/include/std/unordered_map b/libstdc++-v3/include/std/unordered_map index e13bb9a2148..b50ec2a8de2 100644 --- a/libstdc++-v3/include/std/unordered_map +++ b/libstdc++-v3/include/std/unordered_map @@ -35,15 +35,7 @@ # include #else -#include #include -#include -#include -#include -#include -#include // equal_to, _Identity, _Select1st -#include -#include #include #include #include diff --git a/libstdc++-v3/include/std/unordered_set b/libstdc++-v3/include/std/unordered_set index 8b665718a83..edaa517635b 100644 --- a/libstdc++-v3/include/std/unordered_set +++ b/libstdc++-v3/include/std/unordered_set @@ -35,15 +35,7 @@ # include #else -#include #include -#include -#include -#include -#include -#include // equal_to, _Identity, _Select1st -#include -#include #include #include #include