Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r79548 - in branches/release: . boost boost/functional boost/functional/hash boost/functional/hash/detail libs libs/functional libs/functional/hash/test
From: dnljms_at_[hidden]
Date: 2012-07-15 20:18:30


Author: danieljames
Date: 2012-07-15 20:18:30 EDT (Sun, 15 Jul 2012)
New Revision: 79548
URL: http://svn.boost.org/trac/boost/changeset/79548

Log:
Hash: Merge support for smart pointers.

Added:
   branches/release/libs/functional/hash/test/hash_std_smart_ptr_test.cpp
      - copied, changed from r79516, /trunk/libs/functional/hash/test/hash_std_smart_ptr_test.cpp
Properties modified:
   branches/release/ (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost/functional/ (props changed)
   branches/release/libs/ (props changed)
   branches/release/libs/functional/ (props changed)
Text files modified:
   branches/release/boost/functional/hash/detail/container_fwd_0x.hpp | 14 ++++++++++++++
   branches/release/boost/functional/hash/extensions.hpp | 12 ++++++++++++
   branches/release/libs/functional/hash/test/Jamfile.v2 | 1 +
   branches/release/libs/functional/hash/test/hash_std_smart_ptr_test.cpp | 2 +-
   4 files changed, 28 insertions(+), 1 deletions(-)

Modified: branches/release/boost/functional/hash/detail/container_fwd_0x.hpp
==============================================================================
--- branches/release/boost/functional/hash/detail/container_fwd_0x.hpp (original)
+++ branches/release/boost/functional/hash/detail/container_fwd_0x.hpp 2012-07-15 20:18:30 EDT (Sun, 15 Jul 2012)
@@ -38,4 +38,18 @@
 # endif
 #endif
 
+// std::shared_ptr/std::unique_ptr
+
+#if !defined(BOOST_NO_CXX11_HDR_MEMORY)
+# if (defined(BOOST_DETAIL_NO_CONTAINER_FWD) && \
+ !defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD))
+# include <memory>
+# else
+namespace std {
+ template <class> class shared_ptr;
+ template <class, class> class unique_ptr;
+}
+# endif
+#endif
+
 #endif

Modified: branches/release/boost/functional/hash/extensions.hpp
==============================================================================
--- branches/release/boost/functional/hash/extensions.hpp (original)
+++ branches/release/boost/functional/hash/extensions.hpp 2012-07-15 20:18:30 EDT (Sun, 15 Jul 2012)
@@ -179,6 +179,18 @@
 
 #endif
 
+#if !defined(BOOST_NO_CXX11_SMART_PTR)
+ template <typename T>
+ inline std::size_t hash_value(std::shared_ptr<T> const& x) {
+ return boost::hash_value(x.get());
+ }
+
+ template <typename T, typename Deleter>
+ inline std::size_t hash_value(std::unique_ptr<T, Deleter> const& x) {
+ return boost::hash_value(x.get());
+ }
+#endif
+
     //
     // call_hash_impl
     //

Modified: branches/release/libs/functional/hash/test/Jamfile.v2
==============================================================================
--- branches/release/libs/functional/hash/test/Jamfile.v2 (original)
+++ branches/release/libs/functional/hash/test/Jamfile.v2 2012-07-15 20:18:30 EDT (Sun, 15 Jul 2012)
@@ -42,6 +42,7 @@
         [ run hash_type_index_test.cpp ]
         [ run hash_std_array_test.cpp ]
         [ run hash_std_tuple_test.cpp ]
+ [ run hash_std_smart_ptr_test.cpp ]
         [ run link_test.cpp link_test_2.cpp ]
         [ run link_ext_test.cpp link_no_ext_test.cpp ]
         [ run extensions_hpp_test.cpp ]

Copied: branches/release/libs/functional/hash/test/hash_std_smart_ptr_test.cpp (from r79516, /trunk/libs/functional/hash/test/hash_std_smart_ptr_test.cpp)
==============================================================================
--- /trunk/libs/functional/hash/test/hash_std_smart_ptr_test.cpp (original)
+++ branches/release/libs/functional/hash/test/hash_std_smart_ptr_test.cpp 2012-07-15 20:18:30 EDT (Sun, 15 Jul 2012)
@@ -14,7 +14,7 @@
 #include <boost/detail/lightweight_test.hpp>
 #include "./compile_time.hpp"
 
-#if defined(TEST_EXTENSIONS) && !defined(BOOST_NO_CXX11_HDR_TUPLE)
+#if defined(TEST_EXTENSIONS) && !defined(BOOST_NO_CXX11_SMART_PTR)
 #define TEST_SMART_PTRS
 #include <memory>
 #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