[SVN r70063]
This commit is contained in:
Ion Gaztañaga
2011-03-17 16:19:41 +00:00
parent 13fa2907cd
commit b9dce1daae
9 changed files with 39 additions and 42 deletions

View File

@@ -1274,6 +1274,8 @@ class avltree_impl
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

View File

@@ -138,6 +138,10 @@ template <typename T>
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,29 +149,17 @@ struct is_unary_or_binary_function_impl<R (*)()>
template <typename R>
struct is_unary_or_binary_function_impl<R (*)(...)>
{ static const bool value = true; };
/*
#ifdef BOOST_INTRUSIVE_TT_TEST_MSC_FUNC_SIGS
#else // 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; };
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 (__fastcall*)()>
{ 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; };
@@ -175,8 +167,13 @@ struct is_unary_or_binary_function_impl<R (__cdecl*)()>
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,24 +182,16 @@ template <typename R, class T0>
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; };
@@ -210,9 +199,13 @@ struct is_unary_or_binary_function_impl<R (__cdecl*)(T0)>
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,25 +213,17 @@ struct is_unary_or_binary_function_impl<R (*)(T0, T1)>
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
#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)>
{ static const bool value = true; };
template <typename R, class T0, class T1>
struct is_unary_or_binary_function_impl<R (__stdcall*)(T0, T1...)>
{ 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 (__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 @@ template <typename R, class T0, class T1>
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; };

View File

@@ -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 @@ struct get_slist_impl
< 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 @@ class hashtable_impl
//! <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 @@ class hashtable_impl
{
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);

View File

@@ -1286,6 +1286,8 @@ class rbtree_impl
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

View File

@@ -1453,6 +1453,8 @@ class sgtree_impl
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

View File

@@ -1261,6 +1261,8 @@ class splaytree_impl
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

View File

@@ -1387,6 +1387,8 @@ class treap_impl
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

View File

@@ -39,7 +39,7 @@ namespace intrusive {
//! 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 @@ class unordered_set
//! 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