Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70063 - in trunk/boost/intrusive: . detail
From: igaztanaga_at_[hidden]
Date: 2011-03-17 12:19:49


Author: igaztanaga
Date: 2011-03-17 12:19:41 EDT (Thu, 17 Mar 2011)
New Revision: 70063
URL: http://svn.boost.org/trac/boost/changeset/70063

Log:
Ticket #5183
Added:
   trunk/boost/intrusive/parent_from_member.hpp
      - copied unchanged from r68070, /trunk/boost/intrusive/parent_from_member.hpp
Properties modified:
   trunk/boost/intrusive/ (props changed)
Text files modified:
   trunk/boost/intrusive/avltree.hpp | 2 +
   trunk/boost/intrusive/detail/mpl.hpp | 57 ++++++++++++++-------------------------
   trunk/boost/intrusive/hashtable.hpp | 8 +++--
   trunk/boost/intrusive/options.hpp | 2
   trunk/boost/intrusive/rbtree.hpp | 2 +
   trunk/boost/intrusive/sgtree.hpp | 2 +
   trunk/boost/intrusive/splaytree.hpp | 2 +
   trunk/boost/intrusive/treap.hpp | 2 +
   trunk/boost/intrusive/unordered_set.hpp | 4 +-
   9 files changed, 39 insertions(+), 42 deletions(-)

Modified: trunk/boost/intrusive/avltree.hpp
==============================================================================
--- trunk/boost/intrusive/avltree.hpp (original)
+++ trunk/boost/intrusive/avltree.hpp 2011-03-17 12:19:41 EDT (Thu, 17 Mar 2011)
@@ -1274,6 +1274,8 @@
       node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
                                    , node_ptr(&priv_header())
                                    , get_real_value_traits().to_node_ptr(with_this));
+ if(safemode_or_autounlink)
+ node_algorithms::init(replace_this.pointed_node());
    }
 
    //! <b>Requires</b>: value must be an lvalue and shall be in a set of

Modified: trunk/boost/intrusive/detail/mpl.hpp
==============================================================================
--- trunk/boost/intrusive/detail/mpl.hpp (original)
+++ trunk/boost/intrusive/detail/mpl.hpp 2011-03-17 12:19:41 EDT (Thu, 17 Mar 2011)
@@ -138,6 +138,10 @@
 struct is_unary_or_binary_function_impl
 { static const bool value = false; };
 
+// see boost ticket #4094
+// avoid duplicate definitions of is_unary_or_binary_function_impl
+#ifndef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
+
 template <typename R>
 struct is_unary_or_binary_function_impl<R (*)()>
 { static const bool value = true; };
@@ -145,19 +149,11 @@
 template <typename R>
 struct is_unary_or_binary_function_impl<R (*)(...)>
 { static const bool value = true; };
-/*
-#ifdef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
-
-template <typename R>
-struct is_unary_or_binary_function_impl<R (__stdcall*)()>
-{ static const bool value = true; };
 
-template <typename R>
-struct is_unary_or_binary_function_impl<R (__stdcall*)(...)>
-{ static const bool value = true; };
+#else // BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
 
 template <typename R>
-struct is_unary_or_binary_function_impl<R (__stdcall*)(...)>
+struct is_unary_or_binary_function_impl<R (__stdcall*)()>
 { static const bool value = true; };
 
 template <typename R>
@@ -165,18 +161,19 @@
 { static const bool value = true; };
 
 template <typename R>
-struct is_unary_or_binary_function_impl<R (__fastcall*)(...)>
-{ static const bool value = true; };
-
-template <typename R>
 struct is_unary_or_binary_function_impl<R (__cdecl*)()>
 { static const bool value = true; };
 
 template <typename R>
 struct is_unary_or_binary_function_impl<R (__cdecl*)(...)>
 { static const bool value = true; };
+
 #endif
-*/
+
+// see boost ticket #4094
+// avoid duplicate definitions of is_unary_or_binary_function_impl
+#ifndef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
+
 template <typename R, class T0>
 struct is_unary_or_binary_function_impl<R (*)(T0)>
 { static const bool value = true; };
@@ -185,34 +182,30 @@
 struct is_unary_or_binary_function_impl<R (*)(T0...)>
 { static const bool value = true; };
 
-#ifdef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
+#else // BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
 
 template <typename R, class T0>
 struct is_unary_or_binary_function_impl<R (__stdcall*)(T0)>
 { static const bool value = true; };
-/*
-template <typename R, class T0>
-struct is_unary_or_binary_function_impl<R (__stdcall*)(T0...)>
-{ static const bool value = true; };
 
 template <typename R, class T0>
 struct is_unary_or_binary_function_impl<R (__fastcall*)(T0)>
 { static const bool value = true; };
 
 template <typename R, class T0>
-struct is_unary_or_binary_function_impl<R (__fastcall*)(T0...)>
-{ static const bool value = true; };
-
-template <typename R, class T0>
 struct is_unary_or_binary_function_impl<R (__cdecl*)(T0)>
 { static const bool value = true; };
 
 template <typename R, class T0>
 struct is_unary_or_binary_function_impl<R (__cdecl*)(T0...)>
 { static const bool value = true; };
-*/
+
 #endif
 
+// see boost ticket #4094
+// avoid duplicate definitions of is_unary_or_binary_function_impl
+#ifndef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
+
 template <typename R, class T0, class T1>
 struct is_unary_or_binary_function_impl<R (*)(T0, T1)>
 { static const bool value = true; };
@@ -220,15 +213,11 @@
 template <typename R, class T0, class T1>
 struct is_unary_or_binary_function_impl<R (*)(T0, T1...)>
 { static const bool value = true; };
-/*
-#ifdef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
 
-template <typename R, class T0, class T1>
-struct is_unary_or_binary_function_impl<R (__stdcall*)(T0, T1)>
-{ static const bool value = true; };
+#else // BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
 
 template <typename R, class T0, class T1>
-struct is_unary_or_binary_function_impl<R (__stdcall*)(T0, T1...)>
+struct is_unary_or_binary_function_impl<R (__stdcall*)(T0, T1)>
 { static const bool value = true; };
 
 template <typename R, class T0, class T1>
@@ -236,10 +225,6 @@
 { static const bool value = true; };
 
 template <typename R, class T0, class T1>
-struct is_unary_or_binary_function_impl<R (__fastcall*)(T0, T1...)>
-{ static const bool value = true; };
-
-template <typename R, class T0, class T1>
 struct is_unary_or_binary_function_impl<R (__cdecl*)(T0, T1)>
 { static const bool value = true; };
 
@@ -247,7 +232,7 @@
 struct is_unary_or_binary_function_impl<R (__cdecl*)(T0, T1...)>
 { static const bool value = true; };
 #endif
-*/
+
 template <typename T>
 struct is_unary_or_binary_function_impl<T&>
 { static const bool value = false; };

Modified: trunk/boost/intrusive/hashtable.hpp
==============================================================================
--- trunk/boost/intrusive/hashtable.hpp (original)
+++ trunk/boost/intrusive/hashtable.hpp 2011-03-17 12:19:41 EDT (Thu, 17 Mar 2011)
@@ -37,6 +37,7 @@
 #include <boost/intrusive/unordered_set_hook.hpp>
 #include <boost/intrusive/slist.hpp>
 #include <boost/intrusive/detail/mpl.hpp>
+#include <boost/type_traits.hpp>
 
 namespace boost {
 namespace intrusive {
@@ -123,7 +124,7 @@
       < typename NodeTraits::node
       , boost::intrusive::value_traits<trivial_traits>
       , boost::intrusive::constant_time_size<false>
- , boost::intrusive::size_type<std::size_t>
+ , boost::intrusive::size_type<typename boost::make_unsigned<typename std::iterator_traits<typename NodeTraits::node_ptr>::difference_type>::type>
>::type
    {};
 };
@@ -1677,7 +1678,8 @@
    //! <b>Throws</b>: If the internal hash function throws.
    const_iterator iterator_to(const_reference value) const
    {
- return const_iterator(bucket_type::s_iterator_to(priv_value_to_node(const_cast<reference>(value))), this);
+ siterator sit = bucket_type::s_iterator_to(const_cast<node &>(this->priv_value_to_node(value)));
+ return const_iterator(sit, this);
    }
 
    //! <b>Requires</b>: value must be an lvalue and shall be in a unordered_set of
@@ -2147,7 +2149,7 @@
    {
       const std::size_t *primes = &detail::prime_list_holder<0>::prime_list[0];
       const std::size_t *primes_end = primes + detail::prime_list_holder<0>::prime_list_size;
- size_type const* bound = std::lower_bound(primes, primes_end, n);
+ std::size_t const* bound = std::lower_bound(primes, primes_end, n);
       if(bound == primes_end)
          --bound;
       return size_type(*bound);

Modified: trunk/boost/intrusive/options.hpp
==============================================================================
--- trunk/boost/intrusive/options.hpp (original)
+++ trunk/boost/intrusive/options.hpp 2011-03-17 12:19:41 EDT (Thu, 17 Mar 2011)
@@ -775,7 +775,7 @@
 struct do_pack<typelist<Prev, Others...> >
 {
    typedef typename Prev::template pack
- <typename do_pack<typelist<Others...>>::type> type;
+ <typename do_pack<typelist<Others...> >::type> type;
 };
 
 

Modified: trunk/boost/intrusive/rbtree.hpp
==============================================================================
--- trunk/boost/intrusive/rbtree.hpp (original)
+++ trunk/boost/intrusive/rbtree.hpp 2011-03-17 12:19:41 EDT (Thu, 17 Mar 2011)
@@ -1286,6 +1286,8 @@
       node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
                                    , node_ptr(&priv_header())
                                    , get_real_value_traits().to_node_ptr(with_this));
+ if(safemode_or_autounlink)
+ node_algorithms::init(replace_this.pointed_node());
    }
 
    //! <b>Requires</b>: value must be an lvalue and shall be in a set of

Modified: trunk/boost/intrusive/sgtree.hpp
==============================================================================
--- trunk/boost/intrusive/sgtree.hpp (original)
+++ trunk/boost/intrusive/sgtree.hpp 2011-03-17 12:19:41 EDT (Thu, 17 Mar 2011)
@@ -1453,6 +1453,8 @@
       node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
                                    , node_ptr(&priv_header())
                                    , get_real_value_traits().to_node_ptr(with_this));
+ if(safemode_or_autounlink)
+ node_algorithms::init(replace_this.pointed_node());
    }
 
    //! <b>Requires</b>: value must be an lvalue and shall be in a set of

Modified: trunk/boost/intrusive/splaytree.hpp
==============================================================================
--- trunk/boost/intrusive/splaytree.hpp (original)
+++ trunk/boost/intrusive/splaytree.hpp 2011-03-17 12:19:41 EDT (Thu, 17 Mar 2011)
@@ -1261,6 +1261,8 @@
       node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
                                    , node_ptr(&priv_header())
                                    , get_real_value_traits().to_node_ptr(with_this));
+ if(safemode_or_autounlink)
+ node_algorithms::init(replace_this.pointed_node());
    }
 
    //! <b>Requires</b>: value must be an lvalue and shall be in a set of

Modified: trunk/boost/intrusive/treap.hpp
==============================================================================
--- trunk/boost/intrusive/treap.hpp (original)
+++ trunk/boost/intrusive/treap.hpp 2011-03-17 12:19:41 EDT (Thu, 17 Mar 2011)
@@ -1387,6 +1387,8 @@
       node_algorithms::replace_node( get_real_value_traits().to_node_ptr(*replace_this)
                                    , node_ptr(&priv_header())
                                    , get_real_value_traits().to_node_ptr(with_this));
+ if(safemode_or_autounlink)
+ node_algorithms::init(replace_this.pointed_node());
    }
 
    //! <b>Requires</b>: value must be an lvalue and shall be in a set of

Modified: trunk/boost/intrusive/unordered_set.hpp
==============================================================================
--- trunk/boost/intrusive/unordered_set.hpp (original)
+++ trunk/boost/intrusive/unordered_set.hpp 2011-03-17 12:19:41 EDT (Thu, 17 Mar 2011)
@@ -39,7 +39,7 @@
 //! The container supports the following options:
 //! \c base_hook<>/member_hook<>/value_traits<>,
 //! \c constant_time_size<>, \c size_type<>, \c hash<> and \c equal<>
-//! \c bucket_traits<>, power_2_buckets<> and cache_begin<>.
+//! \c bucket_traits<>, \c power_2_buckets<> and \c cache_begin<>.
 //!
 //! unordered_set only provides forward iterators but it provides 4 iterator types:
 //! iterator and const_iterator to navigate through the whole container and
@@ -1096,7 +1096,7 @@
 //! The container supports the following options:
 //! \c base_hook<>/member_hook<>/value_traits<>,
 //! \c constant_time_size<>, \c size_type<>, \c hash<> and \c equal<>
-//! \c bucket_traits<>, power_2_buckets<> and cache_begin<>.
+//! \c bucket_traits<>, \c power_2_buckets<> and \c cache_begin<>.
 //!
 //! unordered_multiset only provides forward iterators but it provides 4 iterator types:
 //! iterator and const_iterator to navigate through the whole container and


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