From ffec55693bb4ba5c7dc6e8b39e6e6aef6087bc48 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Thu, 9 Feb 2006 18:57:07 +0000 Subject: [PATCH] Move all the boost/functional/hash/*.hpp files into a single file (hash/hash.hpp for now, but will eventually move into hash.hpp), add warnings that the old headers are deprecated. [SVN r32778] --- include/boost/functional/hash.hpp | 6 -- include/boost/functional/hash/Attic/deque.hpp | 27 +------- include/boost/functional/hash/Attic/list.hpp | 27 +------- include/boost/functional/hash/Attic/map.hpp | 43 +----------- include/boost/functional/hash/Attic/pair.hpp | 30 +------- include/boost/functional/hash/Attic/set.hpp | 42 +----------- .../boost/functional/hash/Attic/vector.hpp | 27 +------- include/boost/functional/hash/deque.hpp | 27 +------- include/boost/functional/hash/hash.hpp | 68 +++++++++++++++++++ include/boost/functional/hash/list.hpp | 27 +------- include/boost/functional/hash/map.hpp | 43 +----------- include/boost/functional/hash/pair.hpp | 30 +------- include/boost/functional/hash/set.hpp | 42 +----------- include/boost/functional/hash/vector.hpp | 27 +------- 14 files changed, 92 insertions(+), 374 deletions(-) diff --git a/include/boost/functional/hash.hpp b/include/boost/functional/hash.hpp index ba81aa3..ceebe66 100644 --- a/include/boost/functional/hash.hpp +++ b/include/boost/functional/hash.hpp @@ -15,11 +15,5 @@ #endif #include -#include -#include -#include -#include -#include -#include #endif diff --git a/include/boost/functional/hash/Attic/deque.hpp b/include/boost/functional/hash/Attic/deque.hpp index 2b1db09..e10e1d0 100644 --- a/include/boost/functional/hash/Attic/deque.hpp +++ b/include/boost/functional/hash/Attic/deque.hpp @@ -14,31 +14,8 @@ # pragma once #endif -#include -#include - -namespace boost -{ - template - std::size_t hash_value(std::deque const& v) - { - return hash_range(v.begin(), v.end()); - } - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - namespace hash_detail - { - template - struct call_hash > - { - static std::size_t call(std::deque const& val) - { - return boost::hash_value(val); - } - }; - } -#endif -} +#warning "boost/functional/hash/deque.hpp is deprecated, use boost/functional/hash.hpp instead." +#include #endif diff --git a/include/boost/functional/hash/Attic/list.hpp b/include/boost/functional/hash/Attic/list.hpp index 6906598..5821681 100644 --- a/include/boost/functional/hash/Attic/list.hpp +++ b/include/boost/functional/hash/Attic/list.hpp @@ -15,31 +15,8 @@ # pragma once #endif -#include -#include - -namespace boost -{ - template - std::size_t hash_value(std::list const& v) - { - return hash_range(v.begin(), v.end()); - } - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - namespace hash_detail - { - template - struct call_hash > - { - static std::size_t call(std::list const& val) - { - return boost::hash_value(val); - } - }; - } -#endif -} +#warning "boost/functional/hash/list.hpp is deprecated, use boost/functional/hash.hpp instead." +#include #endif diff --git a/include/boost/functional/hash/Attic/map.hpp b/include/boost/functional/hash/Attic/map.hpp index fc9ab6e..8f4aeb3 100644 --- a/include/boost/functional/hash/Attic/map.hpp +++ b/include/boost/functional/hash/Attic/map.hpp @@ -15,47 +15,8 @@ # pragma once #endif -#include -#include -#include - -namespace boost -{ - template - std::size_t hash_value(std::map const& v) - { - return hash_range(v.begin(), v.end()); - } - - template - std::size_t hash_value(std::multimap const& v) - { - return hash_range(v.begin(), v.end()); - } - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - namespace hash_detail - { - template - struct call_hash > - { - static std::size_t call(std::map const& val) - { - return boost::hash_value(val); - } - }; - - template - struct call_hash > - { - static std::size_t call(std::multimap const& val) - { - return boost::hash_value(val); - } - }; - } -#endif -} +#warning "boost/functional/hash/map.hpp is deprecated, use boost/functional/hash.hpp instead." +#include #endif diff --git a/include/boost/functional/hash/Attic/pair.hpp b/include/boost/functional/hash/Attic/pair.hpp index 9c9c307..85acbb3 100644 --- a/include/boost/functional/hash/Attic/pair.hpp +++ b/include/boost/functional/hash/Attic/pair.hpp @@ -15,33 +15,7 @@ # pragma once #endif -#include -#include - -namespace boost -{ - template - std::size_t hash_value(std::pair const& v) - { - std::size_t seed = 0; - hash_combine(seed, v.first); - hash_combine(seed, v.second); - return seed; - } - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - namespace hash_detail - { - template - struct call_hash > - { - static std::size_t call(std::pair const& val) - { - return boost::hash_value(val); - } - }; - } -#endif -} +#warning "boost/functional/hash/pair.hpp is deprecated, use boost/functional/hash.hpp instead." +#include #endif diff --git a/include/boost/functional/hash/Attic/set.hpp b/include/boost/functional/hash/Attic/set.hpp index 6e9d6c2..e16b884 100644 --- a/include/boost/functional/hash/Attic/set.hpp +++ b/include/boost/functional/hash/Attic/set.hpp @@ -15,46 +15,8 @@ # pragma once #endif -#include -#include - -namespace boost -{ - template - std::size_t hash_value(std::set const& v) - { - return hash_range(v.begin(), v.end()); - } - - template - std::size_t hash_value(std::multiset const& v) - { - return hash_range(v.begin(), v.end()); - } - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - namespace hash_detail - { - template - struct call_hash > - { - static std::size_t call(std::set const& val) - { - return boost::hash_value(val); - } - }; - - template - struct call_hash > - { - static std::size_t call(std::multiset const& val) - { - return boost::hash_value(val); - } - }; - } -#endif -} +#warning "boost/functional/hash/set.hpp is deprecated, use boost/functional/hash.hpp instead." +#include #endif diff --git a/include/boost/functional/hash/Attic/vector.hpp b/include/boost/functional/hash/Attic/vector.hpp index 5fbda6a..355fc4a 100644 --- a/include/boost/functional/hash/Attic/vector.hpp +++ b/include/boost/functional/hash/Attic/vector.hpp @@ -15,30 +15,7 @@ # pragma once #endif -#include -#include - -namespace boost -{ - template - std::size_t hash_value(std::vector const& v) - { - return hash_range(v.begin(), v.end()); - } - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - namespace hash_detail - { - template - struct call_hash > - { - static std::size_t call(std::vector const& val) - { - return boost::hash_value(val); - } - }; - } -#endif -} +#warning "boost/functional/hash/vector.hpp is deprecated, use boost/functional/hash.hpp instead." +#include #endif diff --git a/include/boost/functional/hash/deque.hpp b/include/boost/functional/hash/deque.hpp index 2b1db09..e10e1d0 100644 --- a/include/boost/functional/hash/deque.hpp +++ b/include/boost/functional/hash/deque.hpp @@ -14,31 +14,8 @@ # pragma once #endif -#include -#include - -namespace boost -{ - template - std::size_t hash_value(std::deque const& v) - { - return hash_range(v.begin(), v.end()); - } - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - namespace hash_detail - { - template - struct call_hash > - { - static std::size_t call(std::deque const& val) - { - return boost::hash_value(val); - } - }; - } -#endif -} +#warning "boost/functional/hash/deque.hpp is deprecated, use boost/functional/hash.hpp instead." +#include #endif diff --git a/include/boost/functional/hash/hash.hpp b/include/boost/functional/hash/hash.hpp index 1e6552a..c3dce3a 100644 --- a/include/boost/functional/hash/hash.hpp +++ b/include/boost/functional/hash/hash.hpp @@ -59,6 +59,23 @@ namespace boost std::size_t hash_value(std::basic_string, A> const&); #endif + template + std::size_t hash_value(std::pair const&); + template + std::size_t hash_value(std::vector const&); + template + std::size_t hash_value(std::list const& v); + template + std::size_t hash_value(std::deque const& v); + template + std::size_t hash_value(std::set const& v); + template + std::size_t hash_value(std::multiset const& v); + template + std::size_t hash_value(std::map const& v); + template + std::size_t hash_value(std::multimap const& v); + // Implementation #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551)) @@ -256,6 +273,57 @@ namespace boost return boost::hash_detail::float_hash_value(v); } + template + std::size_t hash_value(std::pair const& v) + { + std::size_t seed = 0; + hash_combine(seed, v.first); + hash_combine(seed, v.second); + return seed; + } + + template + std::size_t hash_value(std::vector const& v) + { + return hash_range(v.begin(), v.end()); + } + + template + std::size_t hash_value(std::list const& v) + { + return hash_range(v.begin(), v.end()); + } + + template + std::size_t hash_value(std::deque const& v) + { + return hash_range(v.begin(), v.end()); + } + + template + std::size_t hash_value(std::set const& v) + { + return hash_range(v.begin(), v.end()); + } + + template + std::size_t hash_value(std::multiset const& v) + { + return hash_range(v.begin(), v.end()); + } + + template + std::size_t hash_value(std::map const& v) + { + return hash_range(v.begin(), v.end()); + } + + template + std::size_t hash_value(std::multimap const& v) + { + return hash_range(v.begin(), v.end()); + } + // boost::hash template struct hash diff --git a/include/boost/functional/hash/list.hpp b/include/boost/functional/hash/list.hpp index 6906598..5821681 100644 --- a/include/boost/functional/hash/list.hpp +++ b/include/boost/functional/hash/list.hpp @@ -15,31 +15,8 @@ # pragma once #endif -#include -#include - -namespace boost -{ - template - std::size_t hash_value(std::list const& v) - { - return hash_range(v.begin(), v.end()); - } - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - namespace hash_detail - { - template - struct call_hash > - { - static std::size_t call(std::list const& val) - { - return boost::hash_value(val); - } - }; - } -#endif -} +#warning "boost/functional/hash/list.hpp is deprecated, use boost/functional/hash.hpp instead." +#include #endif diff --git a/include/boost/functional/hash/map.hpp b/include/boost/functional/hash/map.hpp index fc9ab6e..8f4aeb3 100644 --- a/include/boost/functional/hash/map.hpp +++ b/include/boost/functional/hash/map.hpp @@ -15,47 +15,8 @@ # pragma once #endif -#include -#include -#include - -namespace boost -{ - template - std::size_t hash_value(std::map const& v) - { - return hash_range(v.begin(), v.end()); - } - - template - std::size_t hash_value(std::multimap const& v) - { - return hash_range(v.begin(), v.end()); - } - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - namespace hash_detail - { - template - struct call_hash > - { - static std::size_t call(std::map const& val) - { - return boost::hash_value(val); - } - }; - - template - struct call_hash > - { - static std::size_t call(std::multimap const& val) - { - return boost::hash_value(val); - } - }; - } -#endif -} +#warning "boost/functional/hash/map.hpp is deprecated, use boost/functional/hash.hpp instead." +#include #endif diff --git a/include/boost/functional/hash/pair.hpp b/include/boost/functional/hash/pair.hpp index 9c9c307..85acbb3 100644 --- a/include/boost/functional/hash/pair.hpp +++ b/include/boost/functional/hash/pair.hpp @@ -15,33 +15,7 @@ # pragma once #endif -#include -#include - -namespace boost -{ - template - std::size_t hash_value(std::pair const& v) - { - std::size_t seed = 0; - hash_combine(seed, v.first); - hash_combine(seed, v.second); - return seed; - } - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - namespace hash_detail - { - template - struct call_hash > - { - static std::size_t call(std::pair const& val) - { - return boost::hash_value(val); - } - }; - } -#endif -} +#warning "boost/functional/hash/pair.hpp is deprecated, use boost/functional/hash.hpp instead." +#include #endif diff --git a/include/boost/functional/hash/set.hpp b/include/boost/functional/hash/set.hpp index 6e9d6c2..e16b884 100644 --- a/include/boost/functional/hash/set.hpp +++ b/include/boost/functional/hash/set.hpp @@ -15,46 +15,8 @@ # pragma once #endif -#include -#include - -namespace boost -{ - template - std::size_t hash_value(std::set const& v) - { - return hash_range(v.begin(), v.end()); - } - - template - std::size_t hash_value(std::multiset const& v) - { - return hash_range(v.begin(), v.end()); - } - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - namespace hash_detail - { - template - struct call_hash > - { - static std::size_t call(std::set const& val) - { - return boost::hash_value(val); - } - }; - - template - struct call_hash > - { - static std::size_t call(std::multiset const& val) - { - return boost::hash_value(val); - } - }; - } -#endif -} +#warning "boost/functional/hash/set.hpp is deprecated, use boost/functional/hash.hpp instead." +#include #endif diff --git a/include/boost/functional/hash/vector.hpp b/include/boost/functional/hash/vector.hpp index 5fbda6a..355fc4a 100644 --- a/include/boost/functional/hash/vector.hpp +++ b/include/boost/functional/hash/vector.hpp @@ -15,30 +15,7 @@ # pragma once #endif -#include -#include - -namespace boost -{ - template - std::size_t hash_value(std::vector const& v) - { - return hash_range(v.begin(), v.end()); - } - -#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - namespace hash_detail - { - template - struct call_hash > - { - static std::size_t call(std::vector const& val) - { - return boost::hash_value(val); - } - }; - } -#endif -} +#warning "boost/functional/hash/vector.hpp is deprecated, use boost/functional/hash.hpp instead." +#include #endif