diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2010-09-22 17:50:36 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-09-22 17:50:36 +0000 |
commit | 5d64ee190c8875dec5f15c0287a425a1e62041a9 (patch) | |
tree | b73cdce0684496f719170bd56a651d918abf795d /libstdc++-v3/include/std | |
parent | 1cf2589d14da2dd092bc8e4423953b99343a3ba7 (diff) | |
download | gcc-5d64ee190c8875dec5f15c0287a425a1e62041a9.zip gcc-5d64ee190c8875dec5f15c0287a425a1e62041a9.tar.gz gcc-5d64ee190c8875dec5f15c0287a425a1e62041a9.tar.bz2 |
functional_hash.h (__hash_base): Add.
2010-09-22 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/functional_hash.h (__hash_base): Add.
(hash): Derive from __hash_base instead.
* include/debug/bitset (hash): Likewise.
* include/debug/vector (hash): Likewise.
* include/std/system_error (hash): Likewise.
* include/std/thread (hash): Likewise.
* include/std/bitset (hash): Likewise.
* include/profile/bitset (hash): Likewise.
* include/profile/vector (hash): Likewise.
* include/bits/basic_string.h (hash): Likewise.
* include/bits/stl_bvector.h (hash): Likewise.
* include/std/typeindex (hash): Do not derive from unary_function,
add result_type and argument_type typedefs; trim includes.
From-SVN: r164528
Diffstat (limited to 'libstdc++-v3/include/std')
-rw-r--r-- | libstdc++-v3/include/std/bitset | 4 | ||||
-rw-r--r-- | libstdc++-v3/include/std/system_error | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/std/thread | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/std/typeindex | 6 |
4 files changed, 7 insertions, 10 deletions
diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset index 6fe1235..d263fae 100644 --- a/libstdc++-v3/include/std/bitset +++ b/libstdc++-v3/include/std/bitset @@ -1495,7 +1495,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /// std::hash specialization for bitset. template<size_t _Nb> struct hash<_GLIBCXX_STD_D::bitset<_Nb>> - : public std::unary_function<_GLIBCXX_STD_D::bitset<_Nb>, size_t> + : public __hash_base<size_t, _GLIBCXX_STD_D::bitset<_Nb>> { size_t operator()(const _GLIBCXX_STD_D::bitset<_Nb>& __b) const @@ -1507,7 +1507,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) template<> struct hash<_GLIBCXX_STD_D::bitset<0>> - : public std::unary_function<_GLIBCXX_STD_D::bitset<0>, size_t> + : public __hash_base<size_t, _GLIBCXX_STD_D::bitset<0>> { size_t operator()(const _GLIBCXX_STD_D::bitset<0>&) const diff --git a/libstdc++-v3/include/std/system_error b/libstdc++-v3/include/std/system_error index 2c968e9..ce4e238 100644 --- a/libstdc++-v3/include/std/system_error +++ b/libstdc++-v3/include/std/system_error @@ -353,7 +353,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) /// std::hash specialization for error_code. template<> struct hash<error_code> - : public std::unary_function<error_code, size_t> + : public __hash_base<size_t, error_code> { size_t operator()(const error_code& __e) const diff --git a/libstdc++-v3/include/std/thread b/libstdc++-v3/include/std/thread index 38e9d45..d5bbf6e 100644 --- a/libstdc++-v3/include/std/thread +++ b/libstdc++-v3/include/std/thread @@ -56,9 +56,6 @@ namespace std * @{ */ - template<typename _Tp> - struct hash; - /// thread class thread { @@ -224,7 +221,7 @@ namespace std /// std::hash specialization for thread::id. template<> struct hash<thread::id> - : public std::unary_function<thread::id, size_t> + : public __hash_base<size_t, thread::id> { size_t operator()(const thread::id& __id) const diff --git a/libstdc++-v3/include/std/typeindex b/libstdc++-v3/include/std/typeindex index a5d3766..44836f6 100644 --- a/libstdc++-v3/include/std/typeindex +++ b/libstdc++-v3/include/std/typeindex @@ -35,9 +35,7 @@ # include <bits/c++0x_warning.h> #else -#include <bits/c++config.h> #include <typeinfo> -#include <bits/stl_function.h> // For unary_function namespace std { @@ -92,8 +90,10 @@ namespace std /// std::hash specialization for type_index. template<> struct hash<type_index> - : public std::unary_function<type_index, size_t> { + typedef size_t result_type; + typedef type_index argument_type; + size_t operator()(const type_index& __ti) const { return __ti.hash_code(); } |