Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74766 - trunk/boost/unordered/detail
From: dnljms_at_[hidden]
Date: 2011-10-06 17:06:36


Author: danieljames
Date: 2011-10-06 17:06:35 EDT (Thu, 06 Oct 2011)
New Revision: 74766
URL: http://svn.boost.org/trac/boost/changeset/74766

Log:
Unordered: More cleaning up.

Fix deprecated construct_impl and explicit namespaces in a few places.
Text files modified:
   trunk/boost/unordered/detail/allocator_helpers.hpp | 57 ++++++++++++++++++++++++---------------
   trunk/boost/unordered/detail/emplace_args.hpp | 18 +++++++-----
   trunk/boost/unordered/detail/extract_key.hpp | 3 +
   3 files changed, 47 insertions(+), 31 deletions(-)

Modified: trunk/boost/unordered/detail/allocator_helpers.hpp
==============================================================================
--- trunk/boost/unordered/detail/allocator_helpers.hpp (original)
+++ trunk/boost/unordered/detail/allocator_helpers.hpp 2011-10-06 17:06:35 EDT (Thu, 06 Oct 2011)
@@ -133,7 +133,8 @@
 #define BOOST_UNORDERED_HAS_FUNCTION(name, thing, args, _) \
     struct BOOST_PP_CAT(has_, name) \
     { \
- BOOST_UNORDERED_CHECK_EXPRESSION(1, 1, make< thing >().name args); \
+ BOOST_UNORDERED_CHECK_EXPRESSION(1, 1, \
+ boost::unordered::detail::make< thing >().name args); \
         BOOST_UNORDERED_DEFAULT_EXPRESSION(2, 2); \
                                                                             \
         enum { value = sizeof(test<T>(choose())) == sizeof(choice1::type) };\
@@ -149,7 +150,8 @@
 
 #define BOOST_UNORDERED_CHECK_MEMBER(count, result, name, member) \
                                                                             \
- typedef typename identity<member>::type BOOST_PP_CAT(check, count); \
+ typedef typename boost::unordered::detail::identity<member>::type \
+ BOOST_PP_CAT(check, count); \
                                                                             \
     template <BOOST_PP_CAT(check, count) e> \
     struct BOOST_PP_CAT(test, count) { \
@@ -207,7 +209,8 @@
         { \
             enum { value = sizeof( \
                 boost::unordered::detail::is_private_type(( \
- make<wrap< thing > >().name args \
+ boost::unordered::detail::make<wrap< thing > >() \
+ .name args \
                 , 0))) == sizeof(yes_type) }; \
         }; \
                                                                             \
@@ -329,12 +332,14 @@
 #if BOOST_UNORDERED_HAVE_CALL_N_DETECTION
     template <typename T, typename ValueType>
     BOOST_UNORDERED_HAS_FUNCTION(
- construct, U, (make<ValueType*>(), make<ValueType const>()), 2
+ construct, U, (
+ boost::unordered::detail::make<ValueType*>(),
+ boost::unordered::detail::make<ValueType const>()), 2
     );
 
     template <typename T, typename ValueType>
     BOOST_UNORDERED_HAS_FUNCTION(
- destroy, U, (make<ValueType*>()), 1
+ destroy, U, (boost::unordered::detail::make<ValueType*>()), 1
     );
 #else
     template <typename T>
@@ -345,31 +350,35 @@
 #endif
 
     template <typename Alloc>
- inline typename boost::enable_if<
- has_select_on_container_copy_construction<Alloc>, Alloc
+ inline typename boost::enable_if_c<
+ boost::unordered::detail::
+ has_select_on_container_copy_construction<Alloc>::value, Alloc
>::type call_select_on_container_copy_construction(const Alloc& rhs)
     {
         return rhs.select_on_container_copy_construction();
     }
 
     template <typename Alloc>
- inline typename boost::disable_if<
- has_select_on_container_copy_construction<Alloc>, Alloc
+ inline typename boost::disable_if_c<
+ boost::unordered::detail::
+ has_select_on_container_copy_construction<Alloc>::value, Alloc
>::type call_select_on_container_copy_construction(const Alloc& rhs)
     {
         return rhs;
     }
 
     template <typename SizeType, typename Alloc>
- SizeType call_max_size(const Alloc& a,
- typename boost::enable_if<has_max_size<Alloc>, void*>::type = 0)
+ inline typename boost::enable_if_c<
+ boost::unordered::detail::has_max_size<Alloc>::value, SizeType
+ >::type call_max_size(const Alloc& a)
     {
         return a.max_size();
     }
 
     template <typename SizeType, typename Alloc>
- SizeType call_max_size(const Alloc&,
- typename boost::disable_if<has_max_size<Alloc>, void*>::type = 0)
+ inline typename boost::disable_if_c<
+ boost::unordered::detail::has_max_size<Alloc>::value, SizeType
+ >::type call_max_size(const Alloc&)
     {
         return std::numeric_limits<SizeType>::max();
     }
@@ -423,29 +432,33 @@
         // Only supporting the basic copy constructor for now.
 
         template <typename T>
- static void construct(Alloc& a, T* p, T const& x, typename
- boost::enable_if<has_construct<Alloc, T>, void*>::type = 0)
+ static typename boost::enable_if_c<
+ boost::unordered::detail::has_construct<Alloc, T>::value>::type
+ construct(Alloc& a, T* p, T const& x)
         {
             a.construct(p, x);
         }
 
         template <typename T>
- static void construct(Alloc&, T* p, T const& x, typename
- boost::disable_if<has_construct<Alloc, T>, void*>::type = 0)
+ static typename boost::disable_if_c<
+ boost::unordered::detail::has_construct<Alloc, T>::value>::type
+ construct(Alloc&, T* p, T const& x)
         {
- new (p) T(x);
+ new ((void*) p) T(x);
         }
 
         template <typename T>
- static void destroy(Alloc& a, T* p, typename
- boost::enable_if<has_destroy<Alloc, T>, void*>::type = 0)
+ static typename boost::enable_if_c<
+ boost::unordered::detail::has_destroy<Alloc, T>::value>::type
+ destroy(Alloc& a, T* p)
         {
             a.destroy(p);
         }
 
         template <typename T>
- static void destroy(Alloc&, T* p, typename
- boost::disable_if<has_destroy<Alloc, T>, void*>::type = 0)
+ static typename boost::disable_if_c<
+ boost::unordered::detail::has_destroy<Alloc, T>::value>::type
+ destroy(Alloc&, T* p)
         {
             boost::unordered::detail::destroy(p);
         }

Modified: trunk/boost/unordered/detail/emplace_args.hpp
==============================================================================
--- trunk/boost/unordered/detail/emplace_args.hpp (original)
+++ trunk/boost/unordered/detail/emplace_args.hpp 2011-10-06 17:06:35 EDT (Thu, 06 Oct 2011)
@@ -160,7 +160,7 @@
         boost::detail::if_true<
             boost::is_class<T>::value
>::BOOST_NESTED_TEMPLATE then <
- rv_ref_impl<T>,
+ boost::unordered::detail::rv_ref_impl<T>,
             please_ignore_this_overload
>::type
     {};
@@ -227,7 +227,8 @@
         static choice3::type check(choice3, ...);
 
         enum { value =
- sizeof(check(choose(), make<A0>())) == sizeof(choice2::type) };
+ sizeof(check(choose(), boost::unordered::detail::make<A0>())) ==
+ sizeof(choice2::type) };
     };
 #endif
 
@@ -242,7 +243,8 @@
 
         static choice3::type check(choice3, ...);
 
- enum { value = sizeof(check(choose(), make<A0>())) };
+ enum { value =
+ sizeof(check(choose(), boost::unordered::detail::make<A0>())) };
     };
 
     template <typename A, typename B, typename A0>
@@ -273,9 +275,9 @@
     inline typename enable_if<piecewise3<A, B, A0>, void>::type
         construct_impl(std::pair<A, B>* address, A0&&, A1&& a1, A2&& a2)
     {
- construct_from_tuple(
+ boost::unordered::detail::construct_from_tuple(
             boost::addressof(address->first), a1);
- construct_from_tuple(
+ boost::unordered::detail::construct_from_tuple(
             boost::addressof(address->second), a2);
     }
 
@@ -291,7 +293,7 @@
 
     template <typename A, typename B, typename A0, typename A1, typename A2>
     inline typename enable_if<emulation3<A, B, A0>, void>::type
- construct_impl(T* address, A0&& a0, A1&& a1, A2&& a2)
+ construct_impl(std::pair<A, B>* address, A0&& a0, A1&& a1, A2&& a2)
     {
         new((void*) boost::addressof(address->first)) A(std::forward<A0>(a0));
         new((void*) boost::addressof(address->second)) B(
@@ -345,9 +347,9 @@
         construct_impl(std::pair<A, B>* address,
             boost::unordered::detail::emplace_args3<A0, A1, A2> const& args)
     {
- construct_from_tuple(
+ boost::unordered::detail::construct_from_tuple(
             boost::addressof(address->first), args.a1);
- construct_from_tuple(
+ boost::unordered::detail::construct_from_tuple(
             boost::addressof(address->second), args.a2);
     }
 

Modified: trunk/boost/unordered/detail/extract_key.hpp
==============================================================================
--- trunk/boost/unordered/detail/extract_key.hpp (original)
+++ trunk/boost/unordered/detail/extract_key.hpp 2011-10-06 17:06:35 EDT (Thu, 06 Oct 2011)
@@ -33,7 +33,8 @@
         static choice1::type test(T2 const&);
         static choice2::type test(Key const&);
         
- enum { value = sizeof(test(make<T>())) == sizeof(choice2::type) };
+ enum { value = sizeof(test(boost::unordered::detail::make<T>())) ==
+ sizeof(choice2::type) };
         
         typedef typename boost::detail::if_true<value>::
             BOOST_NESTED_TEMPLATE then<Key const&, no_key>::type type;


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