Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-03-24 08:59:02


Author: danieljames
Date: 2008-03-24 08:59:01 EDT (Mon, 24 Mar 2008)
New Revision: 43818
URL: http://svn.boost.org/trac/boost/changeset/43818

Log:
Move the hash extensions into their own file.
Merged revisions 42735 via svnmerge from
https://svn.boost.org/svn/boost/branches/unordered/dev

........
  r42735 | danieljames | 2008-01-13 19:56:31 +0000 (Sun, 13 Jan 2008) | 1 line
  
  Move the hash extensions into their own file.
........

Added:
   branches/unordered/trunk/boost/functional/hash/extensions.hpp
      - copied unchanged from r42735, /branches/unordered/dev/boost/functional/hash/extensions.hpp
Properties modified:
   branches/unordered/trunk/ (props changed)
Text files modified:
   branches/unordered/trunk/boost/functional/hash.hpp | 4
   branches/unordered/trunk/boost/functional/hash/hash.hpp | 177 ---------------------------------------
   2 files changed, 8 insertions(+), 173 deletions(-)

Modified: branches/unordered/trunk/boost/functional/hash.hpp
==============================================================================
--- branches/unordered/trunk/boost/functional/hash.hpp (original)
+++ branches/unordered/trunk/boost/functional/hash.hpp 2008-03-24 08:59:01 EDT (Mon, 24 Mar 2008)
@@ -8,3 +8,7 @@
 // issue 6.18.
 
 #include <boost/functional/hash/hash.hpp>
+
+#if !defined(BOOST_HASH_NO_EXTENSIONS)
+#include <boost/functional/hash/extensions.hpp>
+#endif

Modified: branches/unordered/trunk/boost/functional/hash/hash.hpp
==============================================================================
--- branches/unordered/trunk/boost/functional/hash/hash.hpp (original)
+++ branches/unordered/trunk/boost/functional/hash/hash.hpp 2008-03-24 08:59:01 EDT (Mon, 24 Mar 2008)
@@ -10,6 +10,10 @@
 #if !defined(BOOST_FUNCTIONAL_HASH_HASH_HPP)
 #define BOOST_FUNCTIONAL_HASH_HASH_HPP
 
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
 #include <boost/functional/hash_fwd.hpp>
 #include <functional>
 #include <boost/functional/detail/hash_float.hpp>
@@ -518,176 +522,3 @@
 }
 
 #endif // BOOST_FUNCTIONAL_HASH_HASH_HPP
-////////////////////////////////////////////////////////////////////////////////
-
-#if !defined(BOOST_HASH_NO_EXTENSIONS) \
- && !defined(BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP)
-#define BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP
-
-namespace boost
-{
-
-#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
- namespace hash_detail
- {
- template <bool IsArray>
- struct call_hash_impl
- {
- template <class T>
- struct inner
- {
- static std::size_t call(T const& v)
- {
- using namespace boost;
- return hash_value(v);
- }
- };
- };
-
- template <>
- struct call_hash_impl<true>
- {
- template <class Array>
- struct inner
- {
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
- static std::size_t call(Array const& v)
-#else
- static std::size_t call(Array& v)
-#endif
- {
- const int size = sizeof(v) / sizeof(*v);
- return boost::hash_range(v, v + size);
- }
- };
- };
-
- template <class T>
- struct call_hash
- : public call_hash_impl<boost::is_array<T>::value>
- ::BOOST_NESTED_TEMPLATE inner<T>
- {
- };
- }
-#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
-
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-
- template <class T> struct hash
- : std::unary_function<T, std::size_t>
- {
-#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
- std::size_t operator()(T const& val) const
- {
- return hash_value(val);
- }
-#else
- std::size_t operator()(T const& val) const
- {
- return hash_detail::call_hash<T>::call(val);
- }
-#endif
- };
-
-#if BOOST_WORKAROUND(__DMC__, <= 0x848)
- template <class T, unsigned int n> struct hash<T[n]>
- : std::unary_function<T[n], std::size_t>
- {
- std::size_t operator()(const T* val) const
- {
- return boost::hash_range(val, val+n);
- }
- };
-#endif
-
-#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
- // On compilers without partial specialization, boost::hash<T>
- // has already been declared to deal with pointers, so just
- // need to supply the non-pointer version.
-
- namespace hash_detail
- {
- template <bool IsPointer>
- struct hash_impl;
-
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-
- template <>
- struct hash_impl<false>
- {
- template <class T>
- struct inner
- : std::unary_function<T, std::size_t>
- {
-#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
- std::size_t operator()(T const& val) const
- {
- return hash_value(val);
- }
-#else
- std::size_t operator()(T const& val) const
- {
- return hash_detail::call_hash<T>::call(val);
- }
-#endif
- };
- };
-
-#else // Visual C++ 6.5
-
- // There's probably a more elegant way to Visual C++ 6.5 to work
- // but I don't know what it is.
-
- template <bool IsConst>
- struct hash_impl_msvc
- {
- template <class T>
- struct inner
- : public std::unary_function<T, std::size_t>
- {
- std::size_t operator()(T const& val) const
- {
- return hash_detail::call_hash<T const>::call(val);
- }
-
- std::size_t operator()(T& val) const
- {
- return hash_detail::call_hash<T>::call(val);
- }
- };
- };
-
- template <>
- struct hash_impl_msvc<true>
- {
- template <class T>
- struct inner
- : public std::unary_function<T, std::size_t>
- {
- std::size_t operator()(T& val) const
- {
- return hash_detail::call_hash<T>::call(val);
- }
- };
- };
-
- template <class T>
- struct hash_impl_msvc2
- : public hash_impl_msvc<boost::is_const<T>::value>
- ::BOOST_NESTED_TEMPLATE inner<T> {};
-
- template <>
- struct hash_impl<false>
- {
- template <class T>
- struct inner : public hash_impl_msvc2<T> {};
- };
-
-#endif // Visual C++ 6.5
- }
-#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-}
-
-#endif
-


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk