diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-11 20:10:20 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-11 20:10:20 +0000 |
commit | b297d58a98b1bd7bb2961b51ea311e1e7ff79375 (patch) | |
tree | 66be469ca67cbc445b69264429468ad6ce65ffb3 /libstdc++-v3/include/tr1/functional | |
parent | 2c5cdc405b013bfaa69eb12f23c1d8391826dc3c (diff) | |
download | gcc-b297d58a98b1bd7bb2961b51ea311e1e7ff79375.tar.gz |
2005-11-11 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/24799
* include/tr1/functional (hash): Inherit from std::unary_function.
* testsuite/tr1/6_containers/unordered/hash/24799.cc: New.
PR libstdc++/24805
* include/tr1/boost_shared_ptr.h (swap(shared_ptr<>&, shared_ptr<>&),
swap(weak_ptr<>&, weak_ptr<>&)): Move inside namespace tr1.
* testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/
24805.cc: New.
PR libstdc++/24809
* include/tr1/type_traits (__is_polymorhpic_helper): Adjust destructor.
* testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/
24809.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106796 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/tr1/functional')
-rw-r--r-- | libstdc++-v3/include/tr1/functional | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libstdc++-v3/include/tr1/functional b/libstdc++-v3/include/tr1/functional index 905e6cbfb25..9672da8fe7c 100644 --- a/libstdc++-v3/include/tr1/functional +++ b/libstdc++-v3/include/tr1/functional @@ -1103,6 +1103,7 @@ namespace tr1 #define tr1_hashtable_define_trivial_hash(T) \ template<> \ struct hash<T> \ + : public std::unary_function<T, std::size_t> \ { \ std::size_t \ operator()(T val) const \ @@ -1125,6 +1126,7 @@ namespace tr1 template<typename T> struct hash<T*> + : public std::unary_function<T*, std::size_t> { std::size_t operator()(T* p) const @@ -1185,7 +1187,8 @@ namespace tr1 // for TR1 .cc files, these should go in one. template<> struct hash<std::string> - { + : public std::unary_function<std::string, std::size_t> + { std::size_t operator()(const std::string& s) const { return Fnv_hash<>::hash(s.data(), s.length()); } @@ -1194,6 +1197,7 @@ namespace tr1 #ifdef _GLIBCXX_USE_WCHAR_T template<> struct hash<std::wstring> + : public std::unary_function<std::wstring, std::size_t> { std::size_t operator()(const std::wstring& s) const @@ -1206,6 +1210,7 @@ namespace tr1 template<> struct hash<float> + : public std::unary_function<float, std::size_t> { std::size_t operator()(float fval) const @@ -1222,6 +1227,7 @@ namespace tr1 template<> struct hash<double> + : public std::unary_function<double, std::size_t> { std::size_t operator()(double dval) const @@ -1240,6 +1246,7 @@ namespace tr1 // 10 bytes -> 12 bytes) and resort to frexp. template<> struct hash<long double> + : public std::unary_function<long double, std::size_t> { std::size_t operator()(long double ldval) const |