|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81662 - in branches/release: boost/intrusive boost/intrusive/detail libs/intrusive libs/intrusive/doc libs/intrusive/test
From: igaztanaga_at_[hidden]
Date: 2012-12-01 17:56:15
Author: igaztanaga
Date: 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
New Revision: 81662
URL: http://svn.boost.org/trac/boost/changeset/81662
Log:
Merged intrusive from trunk
Properties modified:
branches/release/boost/intrusive/ (props changed)
branches/release/libs/intrusive/ (props changed)
Text files modified:
branches/release/boost/intrusive/avl_set.hpp | 8
branches/release/boost/intrusive/avltree.hpp | 16
branches/release/boost/intrusive/circular_list_algorithms.hpp | 2
branches/release/boost/intrusive/detail/memory_util.hpp | 8
branches/release/boost/intrusive/detail/tree_algorithms.hpp | 2
branches/release/boost/intrusive/detail/workaround.hpp | 2
branches/release/boost/intrusive/hashtable.hpp | 208 ++++++++++++------------
branches/release/boost/intrusive/list.hpp | 26 +-
branches/release/boost/intrusive/pointer_traits.hpp | 6
branches/release/boost/intrusive/rbtree.hpp | 4
branches/release/boost/intrusive/set.hpp | 8
branches/release/boost/intrusive/sg_set.hpp | 8
branches/release/boost/intrusive/sgtree.hpp | 12
branches/release/boost/intrusive/slist.hpp | 338 ++++++++++++++++++++++++---------------
branches/release/boost/intrusive/splay_set.hpp | 8
branches/release/boost/intrusive/splaytree.hpp | 8
branches/release/boost/intrusive/treap.hpp | 20 +-
branches/release/boost/intrusive/treap_set.hpp | 12
branches/release/boost/intrusive/unordered_set.hpp | 16
branches/release/libs/intrusive/doc/intrusive.qbk | 10 +
branches/release/libs/intrusive/test/generic_assoc_test.hpp | 10
branches/release/libs/intrusive/test/generic_multiset_test.hpp | 2
branches/release/libs/intrusive/test/generic_set_test.hpp | 2
branches/release/libs/intrusive/test/pointer_traits_test.cpp | 2
branches/release/libs/intrusive/test/stateful_value_traits_test.cpp | 4
branches/release/libs/intrusive/test/test_container.hpp | 18 +
branches/release/libs/intrusive/test/unordered_multiset_test.cpp | 214 ++++++++++++------------
27 files changed, 530 insertions(+), 444 deletions(-)
Modified: branches/release/boost/intrusive/avl_set.hpp
==============================================================================
--- branches/release/boost/intrusive/avl_set.hpp (original)
+++ branches/release/boost/intrusive/avl_set.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -86,8 +86,8 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor of the value_compare object throws.
- avl_set_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ explicit avl_set_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
@@ -1381,8 +1381,8 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor/operator() of the value_compare object throws.
- avl_multiset_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ explicit avl_multiset_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
Modified: branches/release/boost/intrusive/avltree.hpp
==============================================================================
--- branches/release/boost/intrusive/avltree.hpp (original)
+++ branches/release/boost/intrusive/avltree.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -219,8 +219,8 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor of the value_compare object throws. Basic guarantee.
- avltree_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ explicit avltree_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
: data_(cmp, v_traits)
{
node_algorithms::init_header(this->priv_header_ptr());
@@ -542,9 +542,9 @@
template<class Iterator>
void insert_equal(Iterator b, Iterator e)
{
- iterator end_(this->end());
+ iterator iend(this->end());
for (; b != e; ++b)
- this->insert_equal(end_, *b);
+ this->insert_equal(iend, *b);
}
//! <b>Requires</b>: value must be an lvalue
@@ -608,9 +608,9 @@
void insert_unique(Iterator b, Iterator e)
{
if(this->empty()){
- iterator end_(this->end());
+ iterator iend(this->end());
for (; b != e; ++b)
- this->insert_unique(end_, *b);
+ this->insert_unique(iend, *b);
}
else{
for (; b != e; ++b)
@@ -1249,7 +1249,7 @@
//! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
- //! the tree.
+ //! the tree.
//! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
//! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
//!
@@ -1298,7 +1298,7 @@
//! <b>Requires</b>: KeyValueCompare is a function object that induces a strict weak
//! ordering compatible with the strict weak ordering used to create the
- //! the tree.
+ //! the tree.
//! 'lower_key' must not be greater than 'upper_key' according to 'comp'. If
//! 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
//!
Modified: branches/release/boost/intrusive/circular_list_algorithms.hpp
==============================================================================
--- branches/release/boost/intrusive/circular_list_algorithms.hpp (original)
+++ branches/release/boost/intrusive/circular_list_algorithms.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -174,7 +174,7 @@
NodeTraits::set_previous(this_node, prev);
NodeTraits::set_next(this_node, nxt_node);
//nxt_node might be an alias for prev->next_
- //so use it before update it before NodeTraits::set_next(prev, ...)
+ //so use it before NodeTraits::set_next(prev, ...)
//is called and the reference changes it's value
NodeTraits::set_previous(nxt_node, this_node);
NodeTraits::set_next(prev, this_node);
Modified: branches/release/boost/intrusive/detail/memory_util.hpp
==============================================================================
--- branches/release/boost/intrusive/detail/memory_util.hpp (original)
+++ branches/release/boost/intrusive/detail/memory_util.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -149,7 +149,7 @@
template <typename T> struct first_param
{ typedef void type; };
-#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template <template <typename, typename...> class TemplateClass, typename T, typename... Args>
struct first_param< TemplateClass<T, Args...> >
@@ -173,7 +173,7 @@
#define BOOST_PP_LOCAL_LIMITS (0, BOOST_INTRUSIVE_MAX_CONSTRUCTOR_PARAMETERS)
#include BOOST_PP_LOCAL_ITERATE()
-#endif //!defined(BOOST_NO_VARIADIC_TEMPLATES)
+#endif //!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
///////////////////////////
//struct type_rebind_mode
@@ -245,7 +245,7 @@
// OtherArgs>, where OtherArgs comprises zero or more type parameters.
// Many pointers fit this form, hence many pointers will get a
// reasonable default for rebind.
-#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
+#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template <template <class, class...> class Ptr, typename T, class... Tn, class U>
struct type_rebinder<Ptr<T, Tn...>, U, 0u >
@@ -277,7 +277,7 @@
#define BOOST_PP_LOCAL_LIMITS (0, BOOST_INTRUSIVE_MAX_CONSTRUCTOR_PARAMETERS)
#include BOOST_PP_LOCAL_ITERATE()
-#endif //!defined(BOOST_NO_VARIADIC_TEMPLATES)
+#endif //!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
} //namespace detail {
} //namespace intrusive {
Modified: branches/release/boost/intrusive/detail/tree_algorithms.hpp
==============================================================================
--- branches/release/boost/intrusive/detail/tree_algorithms.hpp (original)
+++ branches/release/boost/intrusive/detail/tree_algorithms.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -1020,7 +1020,7 @@
if(hint == header || comp(key, hint)){
node_ptr prev(hint);
//Previous value should be less than the key
- if(hint == begin_node(header)|| comp((prev = prev_node(hint)), key)){
+ if(hint == begin_node(header) || comp((prev = prev_node(hint)), key)){
commit_data.link_left = unique(header) || !NodeTraits::get_left(hint);
commit_data.node = commit_data.link_left ? hint : prev;
if(pdepth){
Modified: branches/release/boost/intrusive/detail/workaround.hpp
==============================================================================
--- branches/release/boost/intrusive/detail/workaround.hpp (original)
+++ branches/release/boost/intrusive/detail/workaround.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -13,7 +13,7 @@
#include <boost/intrusive/detail/config_begin.hpp>
-#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_VARIADIC_TEMPLATES)
+#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#define BOOST_INTRUSIVE_PERFECT_FORWARDING
#endif
Modified: branches/release/boost/intrusive/hashtable.hpp
==============================================================================
--- branches/release/boost/intrusive/hashtable.hpp (original)
+++ branches/release/boost/intrusive/hashtable.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -424,20 +424,20 @@
{
node_ptr nxt_ptr(node_traits::get_next(to_erase_ptr));
node_ptr prev_in_group_ptr(group_traits::get_next(to_erase_ptr));
- bool last_in_group_bool = (end_ptr == nxt_ptr) ||
+ bool last_in_group = (end_ptr == nxt_ptr) ||
(group_traits::get_next(nxt_ptr) != to_erase_ptr);
- bool first_in_group_bool = node_traits::get_next(prev_in_group_ptr) != to_erase_ptr;
+ bool is_first_in_group = node_traits::get_next(prev_in_group_ptr) != to_erase_ptr;
- if(first_in_group_bool && last_in_group_bool){
+ if(is_first_in_group && last_in_group){
group_algorithms::init(to_erase_ptr);
}
- else if(first_in_group_bool){
+ else if(is_first_in_group){
group_algorithms::unlink_after(nxt_ptr);
}
- else if(last_in_group_bool){
- node_ptr first_in_group_ptr =
+ else if(last_in_group){
+ node_ptr first_in_group =
get_first_in_group_of_last_in_group(to_erase_ptr);
- group_algorithms::unlink_after(first_in_group_ptr);
+ group_algorithms::unlink_after(first_in_group);
}
else{
group_algorithms::unlink_after(nxt_ptr);
@@ -888,20 +888,20 @@
//!
//! <b>Notes</b>: buckets array must be disposed only after
//! *this is disposed.
- hashtable_impl ( const bucket_traits &b_traits
- , const hasher & hash_func = hasher()
- , const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
+ explicit hashtable_impl ( const bucket_traits &b_traits
+ , const hasher & hash_func = hasher()
+ , const key_equal &equal_func = key_equal()
+ , const value_traits &v_traits = value_traits())
: data_(b_traits, hash_func, equal_func, v_traits)
{
this->priv_initialize_buckets();
this->priv_size_traits().set_size(size_type(0));
- size_type bucket_size_ = this->priv_bucket_count();
- BOOST_INTRUSIVE_INVARIANT_ASSERT(bucket_size_ != 0);
+ size_type bucket_sz = this->priv_bucket_count();
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(bucket_sz != 0);
//Check power of two bucket array if the option is activated
BOOST_INTRUSIVE_INVARIANT_ASSERT
- (!power_2_buckets || (0 == (bucket_size_ & (bucket_size_-1))));
- this->priv_split_traits().set_size(bucket_size_>>1);
+ (!power_2_buckets || (0 == (bucket_sz & (bucket_sz-1))));
+ this->priv_split_traits().set_size(bucket_sz>>1);
}
//! <b>Effects</b>: to-do
@@ -1026,9 +1026,9 @@
return this->begin() == this->end();
}
else{
- size_type bucket_count_ = this->priv_bucket_count();
+ size_type bucket_cnt = this->priv_bucket_count();
const bucket_type *b = boost::intrusive::detail::to_raw_pointer(this->priv_bucket_pointer());
- for (size_type n = 0; n < bucket_count_; ++n, ++b){
+ for (size_type n = 0; n < bucket_cnt; ++n, ++b){
if(!b->empty()){
return false;
}
@@ -1049,9 +1049,9 @@
return this->priv_size_traits().get_size();
else{
size_type len = 0;
- size_type bucket_count_ = this->priv_bucket_count();
+ size_type bucket_cnt = this->priv_bucket_count();
const bucket_type *b = boost::intrusive::detail::to_raw_pointer(this->priv_bucket_pointer());
- for (size_type n = 0; n < bucket_count_; ++n, ++b){
+ for (size_type n = 0; n < bucket_cnt; ++n, ++b){
len += b->size();
}
return len;
@@ -1468,9 +1468,9 @@
siterator first_local_it(b.slist_it());
size_type first_bucket_num = this->priv_get_bucket_num(first_local_it);
- const bucket_ptr bucket_pointer_ = this->priv_bucket_pointer();
+ const bucket_ptr buck_ptr = this->priv_bucket_pointer();
siterator before_first_local_it
- = this->priv_get_previous(bucket_pointer_[first_bucket_num], first_local_it);
+ = this->priv_get_previous(buck_ptr[first_bucket_num], first_local_it);
size_type last_bucket_num;
siterator last_local_it;
@@ -1478,7 +1478,7 @@
//of the last bucket
if(e == this->end()){
last_bucket_num = this->bucket_count() - 1;
- last_local_it = bucket_pointer_[last_bucket_num].end();
+ last_local_it = buck_ptr[last_bucket_num].end();
}
else{
last_local_it = e.slist_it();
@@ -1533,7 +1533,7 @@
siterator it =
this->priv_find(key, hash_func, equal_func, bucket_num, h, prev);
bool success = it != this->priv_invalid_local_it();
- size_type count_(0);
+ size_type cnt(0);
if(!success){
return 0;
}
@@ -1541,12 +1541,12 @@
siterator last = bucket_type::s_iterator_to
(*node_traits::get_next(group_functions_t::get_last_in_group
(hashtable_impl::dcast_bucket_ptr(it.pointed_node()), optimize_multikey_t())));
- this->priv_erase_range_impl(bucket_num, prev, last, disposer, count_);
+ this->priv_erase_range_impl(bucket_num, prev, last, disposer, cnt);
}
else{
//If found erase all equal values
bucket_type &b = this->priv_bucket_pointer()[bucket_num];
- for(siterator end_ = b.end(); it != end_; ++count_, ++it){
+ for(siterator end_sit = b.end(); it != end_sit; ++cnt, ++it){
slist_node_ptr n(it.pointed_node());
const value_type &v = this->priv_value_from_slist_node(n);
if(compare_hash){
@@ -1563,7 +1563,7 @@
b.erase_after_and_dispose(prev, it, make_node_disposer(disposer));
}
this->priv_erasure_update_cache();
- return count_;
+ return cnt;
}
//! <b>Effects</b>: Erases all of the elements.
@@ -1630,9 +1630,9 @@
template<class KeyType, class KeyHasher, class KeyValueEqual>
size_type count(const KeyType &key, const KeyHasher &hash_func, const KeyValueEqual &equal_func) const
{
- size_type bucket_n1, bucket_n2, count_;
- this->priv_equal_range(key, hash_func, equal_func, bucket_n1, bucket_n2, count_);
- return count_;
+ size_type bucket_n1, bucket_n2, cnt;
+ this->priv_equal_range(key, hash_func, equal_func, bucket_n1, bucket_n2, cnt);
+ return cnt;
}
//! <b>Effects</b>: Finds an iterator to the first element is equal to
@@ -1746,9 +1746,9 @@
std::pair<iterator,iterator> equal_range
(const KeyType &key, KeyHasher hash_func, KeyValueEqual equal_func)
{
- size_type bucket_n1, bucket_n2, count_;
+ size_type bucket_n1, bucket_n2, cnt;
std::pair<siterator, siterator> ret = this->priv_equal_range
- (key, hash_func, equal_func, bucket_n1, bucket_n2, count_);
+ (key, hash_func, equal_func, bucket_n1, bucket_n2, cnt);
return std::pair<iterator, iterator>
(iterator(ret.first, this), iterator(ret.second, this));
}
@@ -1788,9 +1788,9 @@
std::pair<const_iterator,const_iterator> equal_range
(const KeyType &key, KeyHasher hash_func, KeyValueEqual equal_func) const
{
- size_type bucket_n1, bucket_n2, count_;
+ size_type bucket_n1, bucket_n2, cnt;
std::pair<siterator, siterator> ret =
- this->priv_equal_range(key, hash_func, equal_func, bucket_n1, bucket_n2, count_);
+ this->priv_equal_range(key, hash_func, equal_func, bucket_n1, bucket_n2, cnt);
return std::pair<const_iterator, const_iterator>
(const_iterator(ret.first, this), const_iterator(ret.second, this));
}
@@ -2102,9 +2102,9 @@
if(!fast_shrink){
siterator before_i(old_bucket.before_begin());
- siterator end_(old_bucket.end());
+ siterator end_sit(old_bucket.end());
siterator i(old_bucket.begin());
- for(;i != end_; ++i){
+ for(;i != end_sit; ++i){
const value_type &v = this->priv_value_from_slist_node(i.pointed_node());
const std::size_t hash_value = this->priv_stored_or_compute_hash(v, store_hash_t());
const size_type new_n = this->priv_hash_to_bucket(hash_value, new_bucket_count, new_bucket_count);
@@ -2159,19 +2159,19 @@
{
//This function is only available for containers with incremental hashing
BOOST_STATIC_ASSERT(( incremental && power_2_buckets ));
- const size_type split_idx = this->priv_split_traits().get_size();
- const size_type bucket_count_ = this->priv_bucket_count();
- const bucket_ptr bucket_pointer_ = this->priv_bucket_pointer();
+ const size_type split_idx = this->priv_split_traits().get_size();
+ const size_type bucket_cnt = this->priv_bucket_count();
+ const bucket_ptr buck_ptr = this->priv_bucket_pointer();
if(grow){
//Test if the split variable can be changed
- if(split_idx >= bucket_count_)
+ if(split_idx >= bucket_cnt)
return false;
- const size_type bucket_to_rehash = split_idx - bucket_count_/2;
- bucket_type &old_bucket = bucket_pointer_[bucket_to_rehash];
+ const size_type bucket_to_rehash = split_idx - bucket_cnt/2;
+ bucket_type &old_bucket = buck_ptr[bucket_to_rehash];
siterator before_i(old_bucket.before_begin());
- const siterator end_(old_bucket.end());
+ const siterator end_sit(old_bucket.end());
siterator i(old_bucket.begin());
this->priv_split_traits().increment();
@@ -2179,8 +2179,8 @@
//moving elements from old_bucket to the target bucket, all moved
//elements are moved back to the original one.
detail::incremental_rehash_rollback<bucket_type, split_traits> rollback
- ( bucket_pointer_[split_idx], old_bucket, this->priv_split_traits());
- for(;i != end_; ++i){
+ ( buck_ptr[split_idx], old_bucket, this->priv_split_traits());
+ for(;i != end_sit; ++i){
const value_type &v = this->priv_value_from_slist_node(i.pointed_node());
const std::size_t hash_value = this->priv_stored_or_compute_hash(v, store_hash_t());
const size_type new_n = this->priv_hash_to_bucket(hash_value);
@@ -2191,7 +2191,7 @@
before_i = last;
}
else{
- bucket_type &new_b = bucket_pointer_[new_n];
+ bucket_type &new_b = buck_ptr[new_n];
new_b.splice_after(new_b.before_begin(), old_bucket, before_i, last);
}
i = before_i;
@@ -2202,11 +2202,11 @@
}
else{
//Test if the split variable can be changed
- if(split_idx <= bucket_count_/2)
+ if(split_idx <= bucket_cnt/2)
return false;
- const size_type target_bucket_num = split_idx - 1 - bucket_count_/2;
- bucket_type &target_bucket = bucket_pointer_[target_bucket_num];
- bucket_type &source_bucket = bucket_pointer_[split_idx-1];
+ const size_type target_bucket_num = split_idx - 1 - bucket_cnt/2;
+ bucket_type &target_bucket = buck_ptr[target_bucket_num];
+ bucket_type &source_bucket = buck_ptr[split_idx-1];
target_bucket.splice_after(target_bucket.cbefore_begin(), source_bucket);
this->priv_split_traits().decrement();
this->priv_insertion_update_cache(target_bucket_num);
@@ -2324,20 +2324,20 @@
std::size_t priv_hash_to_bucket(std::size_t hash_value) const
{ return this->priv_hash_to_bucket(hash_value, this->priv_real_bucket_traits().bucket_count(), this->priv_split_traits().get_size()); }
- std::size_t priv_hash_to_bucket(std::size_t hash_value, std::size_t bucket_count_, std::size_t split) const
+ std::size_t priv_hash_to_bucket(std::size_t hash_value, std::size_t bucket_cnt, std::size_t split) const
{
- std::size_t bucket_number = hashtable_impl::priv_hash_to_bucket_impl(hash_value, bucket_count_, power_2_buckets_t());
+ std::size_t bucket_number = hashtable_impl::priv_hash_to_bucket_impl(hash_value, bucket_cnt, power_2_buckets_t());
if(incremental)
if(bucket_number >= split)
- bucket_number -= bucket_count_/2;
+ bucket_number -= bucket_cnt/2;
return bucket_number;
}
- static std::size_t priv_hash_to_bucket_impl(std::size_t hash_value, std::size_t bucket_count, detail::false_)
- { return hash_value % bucket_count; }
+ static std::size_t priv_hash_to_bucket_impl(std::size_t hash_value, std::size_t bucket_cnt, detail::false_)
+ { return hash_value % bucket_cnt; }
- static std::size_t priv_hash_to_bucket_impl(std::size_t hash_value, std::size_t bucket_count, detail::true_)
- { return hash_value & (bucket_count - 1); }
+ static std::size_t priv_hash_to_bucket_impl(std::size_t hash_value, std::size_t bucket_cnt, detail::true_)
+ { return hash_value & (bucket_cnt - 1); }
const key_equal &priv_equal() const
{ return static_cast<const key_equal&>(this->data_.internal_.bucket_hash_equal_.get()); }
@@ -2413,20 +2413,20 @@
template<class Disposer>
void priv_erase_range_impl
- (size_type bucket_num, siterator before_first_it, siterator end_, Disposer disposer, size_type &num_erased)
+ (size_type bucket_num, siterator before_first_it, siterator end_sit, Disposer disposer, size_type &num_erased)
{
const bucket_ptr buckets = this->priv_bucket_pointer();
bucket_type &b = buckets[bucket_num];
- if(before_first_it == b.before_begin() && end_ == b.end()){
+ if(before_first_it == b.before_begin() && end_sit == b.end()){
this->priv_erase_range_impl(bucket_num, 1, disposer, num_erased);
}
else{
num_erased = 0;
siterator to_erase(before_first_it);
++to_erase;
- slist_node_ptr end_ptr = end_.pointed_node();
- while(to_erase != end_){
+ slist_node_ptr end_ptr = end_sit.pointed_node();
+ while(to_erase != end_sit){
group_functions_t::erase_from_group(end_ptr, hashtable_impl::dcast_bucket_ptr(to_erase.pointed_node()), optimize_multikey_t());
to_erase = b.erase_after_and_dispose(before_first_it, make_node_disposer(disposer));
++num_erased;
@@ -2447,8 +2447,8 @@
siterator b_begin(b.before_begin());
siterator nxt(b_begin);
++nxt;
- siterator end_(b.end());
- while(nxt != end_){
+ siterator end_sit(b.end());
+ while(nxt != end_sit){
group_functions_t::init_group(hashtable_impl::dcast_bucket_ptr(nxt.pointed_node()), optimize_multikey_t());
nxt = b.erase_after_and_dispose
(b_begin, make_node_disposer(disposer));
@@ -2648,8 +2648,8 @@
siterator priv_begin(detail::false_) const
{
size_type n = 0;
- size_type bucket_count_ = this->priv_bucket_count();
- for (n = 0; n < bucket_count_; ++n){
+ size_type bucket_cnt = this->priv_bucket_count();
+ for (n = 0; n < bucket_cnt; ++n){
bucket_type &b = this->priv_bucket_pointer()[n];
if(!b.empty()){
return b.begin();
@@ -2772,9 +2772,9 @@
void priv_initialize_buckets()
{ this->priv_clear_buckets(this->priv_bucket_pointer(), this->priv_bucket_count()); }
- void priv_clear_buckets(bucket_ptr buckets_ptr, size_type bucket_count_)
+ void priv_clear_buckets(bucket_ptr buckets_ptr, size_type bucket_cnt)
{
- for(; bucket_count_--; ++buckets_ptr){
+ for(; bucket_cnt--; ++buckets_ptr){
if(safemode_or_autounlink){
hashtable_impl::priv_clear_group_nodes(*buckets_ptr, optimize_multikey_t());
buckets_ptr->clear_and_dispose(detail::init_disposer<node_algorithms>());
@@ -2877,10 +2877,10 @@
, KeyValueEqual equal_func
, size_type &bucket_number_first
, size_type &bucket_number_second
- , size_type &count_) const
+ , size_type &cnt) const
{
std::size_t h;
- count_ = 0;
+ cnt = 0;
siterator prev;
//Let's see if the element is present
std::pair<siterator, siterator> to_return
@@ -2890,43 +2890,43 @@
bucket_number_second = bucket_number_first;
return to_return;
}
- //If it's present, find the first that it's not equal in
- //the same bucket
{
- bucket_type &b = this->priv_bucket_pointer()[bucket_number_first];
- siterator it = to_return.first;
- if(optimize_multikey){
- to_return.second = bucket_type::s_iterator_to
- (*node_traits::get_next(group_functions_t::get_last_in_group
- (hashtable_impl::dcast_bucket_ptr(it.pointed_node()), optimize_multikey_t())));
- count_ = std::distance(it, to_return.second);
- if(to_return.second != b.end()){
- bucket_number_second = bucket_number_first;
- return to_return;
- }
- }
- else{
- ++count_;
- ++it;
- while(it != b.end()){
- const value_type &v = this->priv_value_from_slist_node(it.pointed_node());
- if(compare_hash){
- std::size_t hv = this->priv_stored_or_compute_hash(v, store_hash_t());
- if(hv != h || !equal_func(key, v)){
- to_return.second = it;
- bucket_number_second = bucket_number_first;
- return to_return;
- }
- }
- else if(!equal_func(key, v)){
- to_return.second = it;
- bucket_number_second = bucket_number_first;
- return to_return;
- }
- ++it;
- ++count_;
- }
- }
+ //If it's present, find the first that it's not equal in
+ //the same bucket
+ bucket_type &b = this->priv_bucket_pointer()[bucket_number_first];
+ siterator it = to_return.first;
+ if(optimize_multikey){
+ to_return.second = bucket_type::s_iterator_to
+ (*node_traits::get_next(group_functions_t::get_last_in_group
+ (hashtable_impl::dcast_bucket_ptr(it.pointed_node()), optimize_multikey_t())));
+ cnt = std::distance(it, to_return.second);
+ if(to_return.second != b.end()){
+ bucket_number_second = bucket_number_first;
+ return to_return;
+ }
+ }
+ else{
+ ++cnt;
+ ++it;
+ while(it != b.end()){
+ const value_type &v = this->priv_value_from_slist_node(it.pointed_node());
+ if(compare_hash){
+ std::size_t hv = this->priv_stored_or_compute_hash(v, store_hash_t());
+ if(hv != h || !equal_func(key, v)){
+ to_return.second = it;
+ bucket_number_second = bucket_number_first;
+ return to_return;
+ }
+ }
+ else if(!equal_func(key, v)){
+ to_return.second = it;
+ bucket_number_second = bucket_number_first;
+ return to_return;
+ }
+ ++it;
+ ++cnt;
+ }
+ }
}
//If we reached the end, find the first, non-empty bucket
Modified: branches/release/boost/intrusive/list.hpp
==============================================================================
--- branches/release/boost/intrusive/list.hpp (original)
+++ branches/release/boost/intrusive/list.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -202,7 +202,7 @@
//!
//! <b>Throws</b>: If real_value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
- list_impl(const value_traits &v_traits = value_traits())
+ explicit list_impl(const value_traits &v_traits = value_traits())
: data_(v_traits)
{
this->priv_size_traits().set_size(size_type(0));
@@ -916,9 +916,9 @@
}
//! <b>Requires</b>: p must be a valid iterator of *this.
- //! start and end must point to elements contained in list x.
+ //! f and e must point to elements contained in list x.
//!
- //! <b>Effects</b>: Transfers the range pointed by start and end from list x to this list,
+ //! <b>Effects</b>: Transfers the range pointed by f and e from list x to this list,
//! before the the element pointed by p. No destructors or copy constructors are called.
//!
//! <b>Throws</b>: Nothing.
@@ -928,19 +928,19 @@
//!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
- void splice(const_iterator p, list_impl&x, const_iterator start, const_iterator end_)
+ void splice(const_iterator p, list_impl&x, const_iterator f, const_iterator e)
{
if(constant_time_size)
- this->splice(p, x, start, end_, std::distance(start, end_));
+ this->splice(p, x, f, e, std::distance(f, e));
else
- this->splice(p, x, start, end_, 1);//distance is a dummy value
+ this->splice(p, x, f, e, 1);//distance is a dummy value
}
//! <b>Requires</b>: p must be a valid iterator of *this.
- //! start and end must point to elements contained in list x.
- //! n == std::distance(start, end)
+ //! f and e must point to elements contained in list x.
+ //! n == std::distance(f, e)
//!
- //! <b>Effects</b>: Transfers the range pointed by start and end from list x to this list,
+ //! <b>Effects</b>: Transfers the range pointed by f and e from list x to this list,
//! before the the element pointed by p. No destructors or copy constructors are called.
//!
//! <b>Throws</b>: Nothing.
@@ -949,19 +949,19 @@
//!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
- void splice(const_iterator p, list_impl&x, const_iterator start, const_iterator end_, difference_type n)
+ void splice(const_iterator p, list_impl&x, const_iterator f, const_iterator e, difference_type n)
{
if(n){
if(constant_time_size){
size_traits &thist = this->priv_size_traits();
size_traits &xt = x.priv_size_traits();
- BOOST_INTRUSIVE_INVARIANT_ASSERT(n == std::distance(start, end_));
- node_algorithms::transfer(p.pointed_node(), start.pointed_node(), end_.pointed_node());
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(n == std::distance(f, e));
+ node_algorithms::transfer(p.pointed_node(), f.pointed_node(), e.pointed_node());
thist.set_size(thist.get_size() + n);
xt.set_size(xt.get_size() - n);
}
else{
- node_algorithms::transfer(p.pointed_node(), start.pointed_node(), end_.pointed_node());
+ node_algorithms::transfer(p.pointed_node(), f.pointed_node(), e.pointed_node());
}
}
}
Modified: branches/release/boost/intrusive/pointer_traits.hpp
==============================================================================
--- branches/release/boost/intrusive/pointer_traits.hpp (original)
+++ branches/release/boost/intrusive/pointer_traits.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -81,10 +81,10 @@
typedef typename boost::intrusive::detail::type_rebinder<Ptr, U>::type type;
};
- #if !defined(BOOST_NO_TEMPLATE_ALIASES)
+ #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
template <class U> using rebind = typename boost::intrusive::detail::type_rebinder<Ptr, U>::type;
#endif
- #endif //#if !defined(BOOST_NO_TEMPLATE_ALIASES)
+ #endif //#if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
//! <b>Remark</b>: If element_type is (possibly cv-qualified) void, r type is unspecified; otherwise,
//! it is element_type &.
@@ -225,7 +225,7 @@
template <class U> using rebind = U*;
#else
typedef typename boost::intrusive::detail::unvoid<element_type>::type& reference;
- #if !defined(BOOST_NO_TEMPLATE_ALIASES)
+ #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
template <class U> using rebind = U*;
#endif
#endif
Modified: branches/release/boost/intrusive/rbtree.hpp
==============================================================================
--- branches/release/boost/intrusive/rbtree.hpp (original)
+++ branches/release/boost/intrusive/rbtree.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -224,8 +224,8 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructorof the value_compare object throws. Basic guarantee.
- rbtree_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ explicit rbtree_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
: data_(cmp, v_traits)
{
node_algorithms::init_header(this->priv_header_ptr());
Modified: branches/release/boost/intrusive/set.hpp
==============================================================================
--- branches/release/boost/intrusive/set.hpp (original)
+++ branches/release/boost/intrusive/set.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -93,8 +93,8 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor of the value_compare object throws.
- set_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ explicit set_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
@@ -1394,8 +1394,8 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor/operator() of the value_compare object throws.
- multiset_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ explicit multiset_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
Modified: branches/release/boost/intrusive/sg_set.hpp
==============================================================================
--- branches/release/boost/intrusive/sg_set.hpp (original)
+++ branches/release/boost/intrusive/sg_set.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -84,8 +84,8 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor of the value_compare object throws.
- sg_set_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ explicit sg_set_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
@@ -1417,8 +1417,8 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor/operator() of the value_compare object throws.
- sg_multiset_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ explicit sg_multiset_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
Modified: branches/release/boost/intrusive/sgtree.hpp
==============================================================================
--- branches/release/boost/intrusive/sgtree.hpp (original)
+++ branches/release/boost/intrusive/sgtree.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -370,8 +370,8 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructorof the value_compare object throws. Basic guarantee.
- sgtree_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ explicit sgtree_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
: data_(cmp, v_traits)
{
node_algorithms::init_header(this->priv_header_ptr());
@@ -701,9 +701,9 @@
template<class Iterator>
void insert_equal(Iterator b, Iterator e)
{
- iterator end_(this->end());
+ iterator iend(this->end());
for (; b != e; ++b)
- this->insert_equal(end_, *b);
+ this->insert_equal(iend, *b);
}
//! <b>Requires</b>: value must be an lvalue
@@ -767,9 +767,9 @@
void insert_unique(Iterator b, Iterator e)
{
if(this->empty()){
- iterator end_(this->end());
+ iterator iend(this->end());
for (; b != e; ++b)
- this->insert_unique(end_, *b);
+ this->insert_unique(iend, *b);
}
else{
for (; b != e; ++b)
Modified: branches/release/boost/intrusive/slist.hpp
==============================================================================
--- branches/release/boost/intrusive/slist.hpp (original)
+++ branches/release/boost/intrusive/slist.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -186,10 +186,17 @@
{ return this->set_last_node(n, detail::bool_<cache_last>()); }
static node_ptr get_last_node(detail::bool_<false>)
- { return node_ptr(); }
+ {
+ //This function shall not be used if cache_last is not true
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(cache_last);
+ return node_ptr();
+ }
static void set_last_node(const node_ptr &, detail::bool_<false>)
- {}
+ {
+ //This function shall not be used if cache_last is not true
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(cache_last);
+ }
node_ptr get_last_node(detail::bool_<true>)
{ return node_ptr(data_.root_plus_size_.last_); }
@@ -273,19 +280,56 @@
{ return this->get_real_value_traits(detail::bool_<external_value_traits>()); }
public:
+
+ ///@cond
+
+ //! <b>Requires</b>: f and before_l belong to another slist.
+ //!
+ //! <b>Effects</b>: Transfers the range [f, before_l] to this
+ //! list, after the element pointed by prev_pos.
+ //! No destructors or copy constructors are called.
+ //!
+ //! <b>Throws</b>: Nothing.
+ //!
+ //! <b>Complexity</b>: Linear to the number of elements transferred
+ //! if constant_time_size is true. Constant-time otherwise.
+ //!
+ //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
+ //! list. Iterators of this list and all the references are not invalidated.
+ //!
+ //! <b>Warning</b>: Experimental function, don't use it!
+ slist_impl( const node_ptr & f, const node_ptr & before_l
+ , size_type n, const value_traits &v_traits = value_traits())
+ : data_(v_traits)
+ {
+ if(n){
+ this->priv_size_traits().set_size(n);
+ if(cache_last){
+ this->set_last_node(before_l);
+ }
+ node_traits::set_next(this->get_root_node(), f);
+ node_traits::set_next(before_l, this->get_end_node());
+ }
+ else{
+ this->set_default_constructed_state();
+ }
+ }
+
+ ///@endcond
+
//! <b>Effects</b>: constructs an empty list.
//!
//! <b>Complexity</b>: Constant
//!
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks).
- slist_impl(const value_traits &v_traits = value_traits())
+ explicit slist_impl(const value_traits &v_traits = value_traits())
: data_(v_traits)
{ this->set_default_constructed_state(); }
//! <b>Requires</b>: Dereferencing iterator must yield an lvalue of type value_type.
//!
- //! <b>Effects</b>: Constructs a list equal to [first,last).
+ //! <b>Effects</b>: Constructs a list equal to [b ,e).
//!
//! <b>Complexity</b>: Linear in std::distance(b, e). No copy constructors are called.
//!
@@ -406,7 +450,14 @@
void push_back(reference value)
{
BOOST_STATIC_ASSERT((cache_last));
- this->insert_after(const_iterator(this->get_last_node(), this), value);
+ node_ptr n = get_real_value_traits().to_node_ptr(value);
+ if(safemode_or_autounlink)
+ BOOST_INTRUSIVE_SAFE_HOOK_DEFAULT_ASSERT(node_algorithms::inited(n));
+ node_algorithms::link_after(this->get_last_node(), n);
+ if(cache_last){
+ this->set_last_node(n);
+ }
+ this->priv_size_traits().increment();
}
//! <b>Effects</b>: Erases the first element of the list.
@@ -573,9 +624,13 @@
//!
//! <b>Note</b>: This function is present only if cached_last<> option is true.
iterator last()
- { return iterator (this->get_last_node(), this); }
+ {
+ //This function shall not be used if cache_last is not true
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(cache_last);
+ return iterator (this->get_last_node(), this);
+ }
- //! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
+ //! <b>Effects</b>: Returns a const_iterator to the last element contained in the list.
//!
//! <b>Throws</b>: Nothing.
//!
@@ -583,9 +638,13 @@
//!
//! <b>Note</b>: This function is present only if cached_last<> option is true.
const_iterator last() const
- { return const_iterator (this->get_last_node(), this); }
+ {
+ //This function shall not be used if cache_last is not true
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(cache_last);
+ return const_iterator (this->get_last_node(), this);
+ }
- //! <b>Effects</b>: Returns a const_iterator to the first element contained in the list.
+ //! <b>Effects</b>: Returns a const_iterator to the last element contained in the list.
//!
//! <b>Throws</b>: Nothing.
//!
@@ -749,7 +808,7 @@
//! an lvalue of type value_type and prev_p must point to an element
//! contained by the list or to the end node.
//!
- //! <b>Effects</b>: Inserts the [first, last)
+ //! <b>Effects</b>: Inserts the [f, l)
//! after the position prev_p.
//!
//! <b>Throws</b>: Nothing.
@@ -758,10 +817,10 @@
//!
//! <b>Note</b>: Does not affect the validity of iterators and references.
template<class Iterator>
- void insert_after(const_iterator prev_p, Iterator first, Iterator last_)
+ void insert_after(const_iterator prev_p, Iterator f, Iterator l)
{
- for (; first != last_; ++first)
- prev_p = this->insert_after(prev_p, *first);
+ for (; f != l; ++f)
+ prev_p = this->insert_after(prev_p, *f);
}
//! <b>Requires</b>: value must be an lvalue and p must point to an element
@@ -812,7 +871,7 @@
iterator erase_after(const_iterator prev)
{ return this->erase_after_and_dispose(prev, detail::null_disposer()); }
- //! <b>Effects</b>: Erases the range (before_first, last) from
+ //! <b>Effects</b>: Erases the range (before_f, l) from
//! the list. No destructors are called.
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
@@ -825,26 +884,26 @@
//!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased element.
- iterator erase_after(const_iterator before_first, const_iterator last_)
+ iterator erase_after(const_iterator before_f, const_iterator l)
{
if(safemode_or_autounlink || constant_time_size){
- return this->erase_after_and_dispose(before_first, last_, detail::null_disposer());
+ return this->erase_after_and_dispose(before_f, l, detail::null_disposer());
}
else{
- node_ptr bfp = before_first.pointed_node();
- node_ptr lp = last_.pointed_node();
+ const node_ptr bfp = before_f.pointed_node();
+ const node_ptr lp = l.pointed_node();
if(cache_last){
if(lp == this->get_end_node()){
this->set_last_node(bfp);
}
}
node_algorithms::unlink_after(bfp, lp);
- return last_.unconst();
+ return l.unconst();
}
}
- //! <b>Effects</b>: Erases the range (before_first, last) from
- //! the list. n must be std::distance(before_first, last) - 1.
+ //! <b>Effects</b>: Erases the range (before_f, l) from
+ //! the list. n must be std::distance(before_f, l) - 1.
//! No destructors are called.
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
@@ -853,19 +912,19 @@
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: constant-time if link_mode is normal_link.
- //! Linear to the elements (last - before_first) otherwise.
+ //! Linear to the elements (l - before_f) otherwise.
//!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased element.
- iterator erase_after(const_iterator before_first, const_iterator last_, difference_type n)
+ iterator erase_after(const_iterator before_f, const_iterator l, size_type n)
{
- BOOST_INTRUSIVE_INVARIANT_ASSERT(std::distance(++const_iterator(before_first), last_) == difference_type(n));
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(std::distance(++const_iterator(before_f), l) == difference_type(n));
if(safemode_or_autounlink){
- return this->erase_after(before_first, last_);
+ return this->erase_after(before_f, l);
}
else{
- node_ptr bfp = before_first.pointed_node();
- node_ptr lp = last_.pointed_node();
+ const node_ptr bfp = before_f.pointed_node();
+ const node_ptr lp = l.pointed_node();
if(cache_last){
if((lp == this->get_end_node())){
this->set_last_node(bfp);
@@ -875,7 +934,7 @@
if(constant_time_size){
this->priv_size_traits().set_size(this->priv_size_traits().get_size() - n);
}
- return last_.unconst();
+ return l.unconst();
}
}
@@ -894,7 +953,7 @@
iterator erase(const_iterator i)
{ return this->erase_after(this->previous(i)); }
- //! <b>Requires</b>: first and last must be valid iterator to elements in *this.
+ //! <b>Requires</b>: f and l must be valid iterator to elements in *this.
//!
//! <b>Effects</b>: Erases the range pointed by b and e.
//! No destructors are called.
@@ -904,15 +963,15 @@
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Linear to the elements before last.
+ //! <b>Complexity</b>: Linear to the elements before l.
//!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased elements.
- iterator erase(const_iterator first, const_iterator last_)
- { return this->erase_after(this->previous(first), last_); }
+ iterator erase(const_iterator f, const_iterator l)
+ { return this->erase_after(this->previous(f), l); }
- //! <b>Effects</b>: Erases the range [first, last) from
- //! the list. n must be std::distance(first, last).
+ //! <b>Effects</b>: Erases the range [f, l) from
+ //! the list. n must be std::distance(f, l).
//! No destructors are called.
//!
//! <b>Returns</b>: the first element remaining beyond the removed elements,
@@ -920,13 +979,13 @@
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: linear to the elements before first if link_mode is normal_link
- //! and constant_time_size is activated. Linear to the elements before last otherwise.
+ //! <b>Complexity</b>: linear to the elements before f if link_mode is normal_link
+ //! and constant_time_size is activated. Linear to the elements before l otherwise.
//!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased element.
- iterator erase(const_iterator first, const_iterator last_, difference_type n)
- { return this->erase_after(this->previous(first), last_, n); }
+ iterator erase(const_iterator f, const_iterator l, size_type n)
+ { return this->erase_after(this->previous(f), l, n); }
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
@@ -986,7 +1045,7 @@
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
//!
- //! <b>Effects</b>: Erases the range (before_first, last) from
+ //! <b>Effects</b>: Erases the range (before_f, l) from
//! the list.
//! Disposer::operator()(pointer) is called for the removed elements.
//!
@@ -995,13 +1054,13 @@
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Lineal to the elements (last - before_first + 1).
+ //! <b>Complexity</b>: Lineal to the elements (l - before_f + 1).
//!
//! <b>Note</b>: Invalidates the iterators to the erased element.
template<class Disposer>
- iterator erase_after_and_dispose(const_iterator before_first, const_iterator last_, Disposer disposer)
+ iterator erase_after_and_dispose(const_iterator before_f, const_iterator l, Disposer disposer)
{
- node_ptr bfp(before_first.pointed_node()), lp(last_.pointed_node());
+ node_ptr bfp(before_f.pointed_node()), lp(l.pointed_node());
node_ptr fp(node_traits::get_next(bfp));
node_algorithms::unlink_after(bfp, lp);
while(fp != lp){
@@ -1015,7 +1074,7 @@
if(cache_last && (node_traits::get_next(bfp) == this->get_end_node())){
this->set_last_node(bfp);
}
- return last_.unconst();
+ return l.unconst();
}
//! <b>Requires</b>: Disposer::operator()(pointer) shouldn't throw.
@@ -1043,7 +1102,7 @@
{ return this->erase_and_dispose(const_iterator(i), disposer); }
#endif
- //! <b>Requires</b>: first and last must be valid iterator to elements in *this.
+ //! <b>Requires</b>: f and l must be valid iterator to elements in *this.
//! Disposer::operator()(pointer) shouldn't throw.
//!
//! <b>Effects</b>: Erases the range pointed by b and e.
@@ -1056,13 +1115,13 @@
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Linear to the number of erased elements plus linear
- //! to the elements before first.
+ //! to the elements before f.
//!
//! <b>Note</b>: Invalidates the iterators (but not the references) to the
//! erased elements.
template<class Disposer>
- iterator erase_and_dispose(const_iterator first, const_iterator last_, Disposer disposer)
- { return this->erase_after_and_dispose(this->previous(first), last_, disposer); }
+ iterator erase_and_dispose(const_iterator f, const_iterator l, Disposer disposer)
+ { return this->erase_after_and_dispose(this->previous(f), l, disposer); }
//! <b>Requires</b>: Dereferencing iterator must yield
//! an lvalue of type value_type.
@@ -1121,23 +1180,23 @@
//!
//! <b>Complexity</b>: In general, linear to the elements contained in x.
//! Constant-time if cache_last<> option is true and also constant-time if
- //! linear<> option is true "this" is empty and "last" is not used.
+ //! linear<> option is true "this" is empty and "l" is not used.
//!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
//!
- //! <b>Additional note</b>: If the optional parameter "last" is provided, it will be
+ //! <b>Additional note</b>: If the optional parameter "l" is provided, it will be
//! assigned to the last spliced element or prev if x is empty.
//! This iterator can be used as new "prev" iterator for a new splice_after call.
//! that will splice new values after the previously spliced values.
- void splice_after(const_iterator prev, slist_impl &x, const_iterator *last_ = 0)
+ void splice_after(const_iterator prev, slist_impl &x, const_iterator *l = 0)
{
if(x.empty()){
- if(last_) *last_ = prev;
+ if(l) *l = prev;
}
else if(linear && this->empty()){
this->swap(x);
- if(last_) *last_ = this->previous(this->cend());
+ if(l) *l = this->previous(this->cend());
}
else{
const_iterator last_x(x.previous(x.end())); //<- constant time if cache_last is active
@@ -1152,7 +1211,7 @@
node_algorithms::transfer_after( prev_n, x.before_begin().pointed_node(), last_x_n);
this->priv_size_traits().set_size(this->priv_size_traits().get_size() + x.priv_size_traits().get_size());
x.priv_size_traits().set_size(size_type(0));
- if(last_) *last_ = last_x;
+ if(l) *l = last_x;
}
}
@@ -1176,10 +1235,10 @@
}
//! <b>Requires</b>: prev_pos must be a dereferenceable iterator in *this or be
- //! before_begin(), and before_first and before_last belong to x and
- //! ++before_first != x.end() && before_last != x.end().
+ //! before_begin(), and before_f and before_l belong to x and
+ //! ++before_f != x.end() && before_l != x.end().
//!
- //! <b>Effects</b>: Transfers the range (before_first, before_last] from list x to this
+ //! <b>Effects</b>: Transfers the range (before_f, before_l] from list x to this
//! list, after the element pointed by prev_pos.
//! No destructors or copy constructors are called.
//!
@@ -1190,21 +1249,21 @@
//!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
- void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator before_first, const_iterator before_last)
+ void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator before_f, const_iterator before_l)
{
if(constant_time_size)
- this->splice_after(prev_pos, x, before_first, before_last, std::distance(before_first, before_last));
+ this->splice_after(prev_pos, x, before_f, before_l, std::distance(before_f, before_l));
else
this->priv_splice_after
- (prev_pos.pointed_node(), x, before_first.pointed_node(), before_last.pointed_node());
+ (prev_pos.pointed_node(), x, before_f.pointed_node(), before_l.pointed_node());
}
//! <b>Requires</b>: prev_pos must be a dereferenceable iterator in *this or be
- //! before_begin(), and before_first and before_last belong to x and
- //! ++before_first != x.end() && before_last != x.end() and
- //! n == std::distance(before_first, before_last).
+ //! before_begin(), and before_f and before_l belong to x and
+ //! ++before_f != x.end() && before_l != x.end() and
+ //! n == std::distance(before_f, before_l).
//!
- //! <b>Effects</b>: Transfers the range (before_first, before_last] from list x to this
+ //! <b>Effects</b>: Transfers the range (before_f, before_l] from list x to this
//! list, after the element pointed by p. No destructors or copy constructors are called.
//!
//! <b>Throws</b>: Nothing.
@@ -1213,16 +1272,14 @@
//!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
- void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator before_first, const_iterator before_last, difference_type n)
+ void splice_after(const_iterator prev_pos, slist_impl &x, const_iterator before_f, const_iterator before_l, size_type n)
{
- if(n){
- BOOST_INTRUSIVE_INVARIANT_ASSERT(std::distance(before_first, before_last) == n);
- this->priv_splice_after
- (prev_pos.pointed_node(), x, before_first.pointed_node(), before_last.pointed_node());
- if(constant_time_size){
- this->priv_size_traits().set_size(this->priv_size_traits().get_size() + n);
- x.priv_size_traits().set_size(x.priv_size_traits().get_size() - n);
- }
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(std::distance(before_f, before_l) == difference_type(n));
+ this->priv_splice_after
+ (prev_pos.pointed_node(), x, before_f.pointed_node(), before_l.pointed_node());
+ if(constant_time_size){
+ this->priv_size_traits().set_size(this->priv_size_traits().get_size() + n);
+ x.priv_size_traits().set_size(x.priv_size_traits().get_size() - n);
}
}
@@ -1243,12 +1300,12 @@
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
//!
- //! <b>Additional note</b>: If the optional parameter "last" is provided, it will be
+ //! <b>Additional note</b>: If the optional parameter "l" is provided, it will be
//! assigned to the last spliced element or prev if x is empty.
//! This iterator can be used as new "prev" iterator for a new splice_after call.
//! that will splice new values after the previously spliced values.
- void splice(const_iterator it, slist_impl &x, const_iterator *last_ = 0)
- { this->splice_after(this->previous(it), x, last_); }
+ void splice(const_iterator it, slist_impl &x, const_iterator *l = 0)
+ { this->splice_after(this->previous(it), x, l); }
//! <b>Requires</b>: it p must be a valid iterator of *this.
//! elem must point to an element contained in list
@@ -1268,43 +1325,43 @@
{ return this->splice_after(this->previous(pos), x, x.previous(elem)); }
//! <b>Requires</b>: pos must be a dereferenceable iterator in *this
- //! and first and last belong to x and first and last a valid range on x.
+ //! and f and f belong to x and f and f a valid range on x.
//!
- //! <b>Effects</b>: Transfers the range [first, last) from list x to this
+ //! <b>Effects</b>: Transfers the range [f, l) from list x to this
//! list, before the element pointed by pos.
//! No destructors or copy constructors are called.
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Linear to the sum of elements before pos, first, and last
+ //! <b>Complexity</b>: Linear to the sum of elements before pos, f, and l
//! plus linear to the number of elements transferred if constant_time_size is true.
- //! Linear to the sum of elements before first, and last
+ //! Linear to the sum of elements before f, and l
//! plus linear to the number of elements transferred if constant_time_size is true
//! if cache_last<> is true and pos == end()
//!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
- void splice(const_iterator pos, slist_impl &x, const_iterator first, const_iterator last_)
- { return this->splice_after(this->previous(pos), x, x.previous(first), x.previous(last_)); }
+ void splice(const_iterator pos, slist_impl &x, const_iterator f, const_iterator l)
+ { return this->splice_after(this->previous(pos), x, x.previous(f), x.previous(l)); }
//! <b>Requires</b>: pos must be a dereferenceable iterator in *this
- //! and first and last belong to x and first and last a valid range on x.
- //! n == std::distance(first, last).
+ //! and f and l belong to x and f and l a valid range on x.
+ //! n == std::distance(f, l).
//!
- //! <b>Effects</b>: Transfers the range [first, last) from list x to this
+ //! <b>Effects</b>: Transfers the range [f, l) from list x to this
//! list, before the element pointed by pos.
//! No destructors or copy constructors are called.
//!
//! <b>Throws</b>: Nothing.
//!
- //! <b>Complexity</b>: Linear to the sum of elements before pos, first, and last.
- //! Linear to the sum of elements before first and last
+ //! <b>Complexity</b>: Linear to the sum of elements before pos, f, and l.
+ //! Linear to the sum of elements before f and l
//! if cache_last<> is true and pos == end().
//!
//! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
//! list. Iterators of this list and all the references are not invalidated.
- void splice(const_iterator pos, slist_impl &x, const_iterator first, const_iterator last_, difference_type n)
- { return this->splice_after(this->previous(pos), x, x.previous(first), x.previous(last_), n); }
+ void splice(const_iterator pos, slist_impl &x, const_iterator f, const_iterator l, size_type n)
+ { return this->splice_after(this->previous(pos), x, x.previous(f), x.previous(l), n); }
//! <b>Effects</b>: This function sorts the list *this according to std::less<value_type>.
//! The sort is stable, that is, the relative order of equivalent elements is preserved.
@@ -1402,14 +1459,14 @@
//!
//! <b>Note</b>: Iterators and references are not invalidated.
//!
- //! <b>Additional note</b>: If optional "last" argument is passed, it is assigned
+ //! <b>Additional note</b>: If optional "l" argument is passed, it is assigned
//! to an iterator to the last transferred value or end() is x is empty.
template<class Predicate>
- void merge(slist_impl& x, Predicate p, const_iterator *last_ = 0)
+ void merge(slist_impl& x, Predicate p, const_iterator *l = 0)
{
const_iterator e(this->cend()), ex(x.cend()), bb(this->cbefore_begin()),
bb_next;
- if(last_) *last_ = e.unconst();
+ if(l) *l = e.unconst();
while(!x.empty()){
const_iterator ibx_next(x.cbefore_begin()), ibx(ibx_next++);
while (++(bb_next = bb) != e && !p(*ibx_next, *bb_next)){
@@ -1417,7 +1474,7 @@
}
if(bb_next == e){
//Now transfer the rest to the end of the container
- this->splice_after(bb, x, last_);
+ this->splice_after(bb, x, l);
break;
}
else{
@@ -1426,7 +1483,7 @@
ibx = ibx_next; ++n;
} while(++(ibx_next = ibx) != ex && p(*ibx_next, *bb_next));
this->splice_after(bb, x, x.before_begin(), ibx, n);
- if(last_) *last_ = ibx;
+ if(l) *l = ibx;
}
}
}
@@ -1728,11 +1785,12 @@
(prev_from.pointed_node(), i.pointed_node()), this);
}
+ ///@cond
+
//! <b>Requires</b>: prev_pos must be a dereferenceable iterator in *this or be
- //! before_begin(), and before_first and before_last belong to x and
- //! ++before_first != x.end() && before_last != x.end().
+ //! before_begin(), and f and before_l belong to another slist.
//!
- //! <b>Effects</b>: Transfers the range (before_first, before_last] to this
+ //! <b>Effects</b>: Transfers the range [f, before_l] to this
//! list, after the element pointed by prev_pos.
//! No destructors or copy constructors are called.
//!
@@ -1741,67 +1799,70 @@
//! <b>Complexity</b>: Linear to the number of elements transferred
//! if constant_time_size is true. Constant-time otherwise.
//!
- //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
- //! list. Iterators of this list and all the references are not invalidated.
- void incorporate_after(const_iterator prev_from, const node_ptr & first, const node_ptr & before_last)
+ //! <b>Note</b>: Iterators of values obtained from the list that owned f and before_l now
+ //! point to elements of this list. Iterators of this list and all the references are not invalidated.
+ //!
+ //! <b>Warning</b>: Experimental function, don't use it!
+ void incorporate_after(const_iterator prev_pos, const node_ptr & f, const node_ptr & before_l)
{
if(constant_time_size)
- this->incorporate_after(prev_from, first, before_last, std::distance(first, before_last)+1);
+ this->incorporate_after(prev_pos, f, before_l, std::distance(f, before_l)+1);
else
- this->priv_incorporate_after
- (prev_from.pointed_node(), first, before_last);
+ this->priv_incorporate_after(prev_pos.pointed_node(), f, before_l);
}
//! <b>Requires</b>: prev_pos must be a dereferenceable iterator in *this or be
- //! before_begin(), and before_first and before_last belong to x and
- //! ++before_first != x.end() && before_last != x.end() and
- //! n == std::distance(first, before_last) + 1.
+ //! before_begin(), and f and before_l belong to another slist.
+ //! n == std::distance(f, before_l) + 1.
//!
- //! <b>Effects</b>: Transfers the range (before_first, before_last] from list x to this
- //! list, after the element pointed by p. No destructors or copy constructors are called.
+ //! <b>Effects</b>: Transfers the range [f, before_l] to this
+ //! list, after the element pointed by prev_pos.
+ //! No destructors or copy constructors are called.
//!
//! <b>Throws</b>: Nothing.
//!
//! <b>Complexity</b>: Constant time.
//!
- //! <b>Note</b>: Iterators of values obtained from list x now point to elements of this
- //! list. Iterators of this list and all the references are not invalidated.
- void incorporate_after(const_iterator prev_pos, const node_ptr & first, const node_ptr & before_last, difference_type n)
+ //! <b>Note</b>: Iterators of values obtained from the list that owned f and before_l now
+ //! point to elements of this list. Iterators of this list and all the references are not invalidated.
+ //!
+ //! <b>Warning</b>: Experimental function, don't use it!
+ void incorporate_after(const_iterator prev_pos, const node_ptr & f, const node_ptr & before_l, size_type n)
{
if(n){
- BOOST_INTRUSIVE_INVARIANT_ASSERT(std::distance(iterator(first, this), iterator(before_last, this))+1 == n);
- this->priv_incorporate_after(prev_pos.pointed_node(), first, before_last);
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(n > 0);
+ BOOST_INTRUSIVE_INVARIANT_ASSERT(size_type(std::distance(iterator(f, this), iterator(before_l, this)))+1 == n);
+ this->priv_incorporate_after(prev_pos.pointed_node(), f, before_l);
if(constant_time_size){
this->priv_size_traits().set_size(this->priv_size_traits().get_size() + n);
}
}
}
+ ///@endcond
+
private:
- void priv_splice_after(const node_ptr & prev_pos_n, slist_impl &x, const node_ptr & before_first_n, const node_ptr & before_last_n)
+ void priv_splice_after(const node_ptr & prev_pos_n, slist_impl &x, const node_ptr & before_f_n, const node_ptr & before_l_n)
{
- if (before_first_n != before_last_n && prev_pos_n != before_first_n && prev_pos_n != before_last_n)
- {
- if(cache_last){
- if(node_traits::get_next(prev_pos_n) == this->get_end_node()){
- this->set_last_node(before_last_n);
- }
- if(node_traits::get_next(before_last_n) == x.get_end_node()){
- x.set_last_node(before_first_n);
- }
+ if (cache_last && (before_f_n != before_l_n)){
+ if(prev_pos_n == this->get_last_node()){
+ this->set_last_node(before_l_n);
+ }
+ if(&x != this && node_traits::get_next(before_l_n) == x.get_end_node()){
+ x.set_last_node(before_f_n);
}
- node_algorithms::transfer_after(prev_pos_n, before_first_n, before_last_n);
}
+ node_algorithms::transfer_after(prev_pos_n, before_f_n, before_l_n);
}
- void priv_incorporate_after(const node_ptr & prev_pos_n, const node_ptr & first_n, const node_ptr & before_last_n)
+ void priv_incorporate_after(const node_ptr & prev_pos_n, const node_ptr & first_n, const node_ptr & before_l_n)
{
if(cache_last){
- if(node_traits::get_next(prev_pos_n) == this->get_end_node()){
- this->set_last_node(before_last_n);
+ if(prev_pos_n == this->get_last_node()){
+ this->set_last_node(before_l_n);
}
}
- node_algorithms::incorporate_after(prev_pos_n, first_n, before_last_n);
+ node_algorithms::incorporate_after(prev_pos_n, first_n, before_l_n);
}
void priv_reverse(detail::bool_<false>)
@@ -1816,9 +1877,9 @@
void priv_shift_backwards(size_type n, detail::bool_<false>)
{
- node_ptr last_ = node_algorithms::move_forward(this->get_root_node(), (std::size_t)n);
- if(cache_last && last_){
- this->set_last_node(last_);
+ node_ptr l = node_algorithms::move_forward(this->get_root_node(), (std::size_t)n);
+ if(cache_last && l){
+ this->set_last_node(l);
}
}
@@ -1837,9 +1898,9 @@
void priv_shift_forward(size_type n, detail::bool_<false>)
{
- node_ptr last_ = node_algorithms::move_backwards(this->get_root_node(), (std::size_t)n);
- if(cache_last && last_){
- this->set_last_node(last_);
+ node_ptr l = node_algorithms::move_backwards(this->get_root_node(), (std::size_t)n);
+ if(cache_last && l){
+ this->set_last_node(l);
}
}
@@ -2100,11 +2161,20 @@
typedef typename Base::value_traits value_traits;
typedef typename Base::iterator iterator;
typedef typename Base::const_iterator const_iterator;
+ typedef typename Base::size_type size_type;
+ typedef typename Base::node_ptr node_ptr;
- slist(const value_traits &v_traits = value_traits())
+ explicit slist(const value_traits &v_traits = value_traits())
: Base(v_traits)
{}
+ struct incorporate_t{};
+
+ slist( const node_ptr & f, const node_ptr & before_l
+ , size_type n, const value_traits &v_traits = value_traits())
+ : Base(f, before_l, n, v_traits)
+ {}
+
template<class Iterator>
slist(Iterator b, Iterator e, const value_traits &v_traits = value_traits())
: Base(b, e, v_traits)
Modified: branches/release/boost/intrusive/splay_set.hpp
==============================================================================
--- branches/release/boost/intrusive/splay_set.hpp (original)
+++ branches/release/boost/intrusive/splay_set.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -86,8 +86,8 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor of the value_compare object throws.
- splay_set_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ explicit splay_set_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
@@ -1404,8 +1404,8 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor/operator() of the value_compare object throws.
- splay_multiset_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ explicit splay_multiset_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, v_traits)
{}
Modified: branches/release/boost/intrusive/splaytree.hpp
==============================================================================
--- branches/release/boost/intrusive/splaytree.hpp (original)
+++ branches/release/boost/intrusive/splaytree.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -214,8 +214,8 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructorof the value_compare object throws. Basic guarantee.
- splaytree_impl( const value_compare &cmp = value_compare()
- , const value_traits &v_traits = value_traits())
+ explicit splaytree_impl( const value_compare &cmp = value_compare()
+ , const value_traits &v_traits = value_traits())
: data_(cmp, v_traits)
{
node_algorithms::init_header(this->priv_header_ptr());
@@ -540,9 +540,9 @@
void insert_equal(Iterator b, Iterator e)
{
if(this->empty()){
- iterator end_(this->end());
+ iterator iend(this->end());
for (; b != e; ++b)
- this->insert_equal(end_, *b);
+ this->insert_equal(iend, *b);
}
}
Modified: branches/release/boost/intrusive/treap.hpp
==============================================================================
--- branches/release/boost/intrusive/treap.hpp (original)
+++ branches/release/boost/intrusive/treap.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -9,8 +9,8 @@
// See http://www.boost.org/libs/intrusive for documentation.
//
/////////////////////////////////////////////////////////////////////////////
-#ifndef BOOST_INTRUSIVE_TRIE_HPP
-#define BOOST_INTRUSIVE_TRIE_HPP
+#ifndef BOOST_INTRUSIVE_TREAP_HPP
+#define BOOST_INTRUSIVE_TREAP_HPP
#include <boost/intrusive/detail/config_begin.hpp>
#include <algorithm>
@@ -232,9 +232,9 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor of the value_compare/priority_compare objects throw. Basic guarantee.
- treap_impl( const value_compare &cmp = value_compare()
- , const priority_compare &pcmp = priority_compare()
- , const value_traits &v_traits = value_traits())
+ explicit treap_impl( const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
: data_(cmp, pcmp, v_traits)
{
node_algorithms::init_header(this->priv_header_ptr());
@@ -627,9 +627,9 @@
template<class Iterator>
void insert_equal(Iterator b, Iterator e)
{
- iterator end_(this->end());
+ iterator iend(this->end());
for (; b != e; ++b)
- this->insert_equal(end_, *b);
+ this->insert_equal(iend, *b);
}
//! <b>Requires</b>: value must be an lvalue
@@ -696,9 +696,9 @@
void insert_unique(Iterator b, Iterator e)
{
if(this->empty()){
- iterator end_(this->end());
+ iterator iend(this->end());
for (; b != e; ++b)
- this->insert_unique(end_, *b);
+ this->insert_unique(iend, *b);
}
else{
for (; b != e; ++b)
@@ -1879,4 +1879,4 @@
#include <boost/intrusive/detail/config_end.hpp>
-#endif //BOOST_INTRUSIVE_TRIE_HPP
+#endif //BOOST_INTRUSIVE_TREAP_HPP
Modified: branches/release/boost/intrusive/treap_set.hpp
==============================================================================
--- branches/release/boost/intrusive/treap_set.hpp (original)
+++ branches/release/boost/intrusive/treap_set.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -87,9 +87,9 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor of the value_compare object throws.
- treap_set_impl( const value_compare &cmp = value_compare()
- , const priority_compare &pcmp = priority_compare()
- , const value_traits &v_traits = value_traits())
+ explicit treap_set_impl( const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, pcmp, v_traits)
{}
@@ -1498,9 +1498,9 @@
//! <b>Throws</b>: If value_traits::node_traits::node
//! constructor throws (this does not happen with predefined Boost.Intrusive hooks)
//! or the copy constructor of the value_compare/priority_compare objects throw.
- treap_multiset_impl( const value_compare &cmp = value_compare()
- , const priority_compare &pcmp = priority_compare()
- , const value_traits &v_traits = value_traits())
+ explicit treap_multiset_impl( const value_compare &cmp = value_compare()
+ , const priority_compare &pcmp = priority_compare()
+ , const value_traits &v_traits = value_traits())
: tree_(cmp, pcmp, v_traits)
{}
Modified: branches/release/boost/intrusive/unordered_set.hpp
==============================================================================
--- branches/release/boost/intrusive/unordered_set.hpp (original)
+++ branches/release/boost/intrusive/unordered_set.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -122,10 +122,10 @@
//!
//! <b>Notes</b>: buckets array must be disposed only after
//! *this is disposed.
- unordered_set_impl( const bucket_traits &b_traits
- , const hasher & hash_func = hasher()
- , const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
+ explicit unordered_set_impl( const bucket_traits &b_traits
+ , const hasher & hash_func = hasher()
+ , const key_equal &equal_func = key_equal()
+ , const value_traits &v_traits = value_traits())
: table_(b_traits, hash_func, equal_func, v_traits)
{}
@@ -1193,10 +1193,10 @@
//!
//! <b>Notes</b>: buckets array must be disposed only after
//! *this is disposed.
- unordered_multiset_impl ( const bucket_traits &b_traits
- , const hasher & hash_func = hasher()
- , const key_equal &equal_func = key_equal()
- , const value_traits &v_traits = value_traits())
+ explicit unordered_multiset_impl ( const bucket_traits &b_traits
+ , const hasher & hash_func = hasher()
+ , const key_equal &equal_func = key_equal()
+ , const value_traits &v_traits = value_traits())
: table_(b_traits, hash_func, equal_func, v_traits)
{}
Modified: branches/release/libs/intrusive/doc/intrusive.qbk
==============================================================================
--- branches/release/libs/intrusive/doc/intrusive.qbk (original)
+++ branches/release/libs/intrusive/doc/intrusive.qbk 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -6,7 +6,7 @@
/]
[library Boost.Intrusive
- [quickbook 1.4]
+ [quickbook 1.5]
[authors [Krzikalla, Olaf], [Gaztanaga, Ion]]
[copyright 2005 Olaf Krzikalla, 2006-2012 Ion Gaztanaga]
[id intrusive]
@@ -3829,6 +3829,14 @@
[section:release_notes Release Notes]
+[section:release_notes_boost_1_53_00 Boost 1.53 Release]
+
+* Fixed GCC -Wshadow warnings.
+* Added missing `explicit` keyword in several intrusive container constructors.
+* Replaced deprecated BOOST_NO_XXXX with newer BOOST_NO_CXX11_XXX macros.
+
+[endsect]
+
[section:release_notes_boost_1_51_00 Boost 1.51 Release]
* Fixed bugs
Modified: branches/release/libs/intrusive/test/generic_assoc_test.hpp
==============================================================================
--- branches/release/libs/intrusive/test/generic_assoc_test.hpp (original)
+++ branches/release/libs/intrusive/test/generic_assoc_test.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -145,10 +145,12 @@
TEST_INTRUSIVE_SEQUENCE_EXPECTED(testset, testset.begin());
//Ordered erasure
- iterator it(testset.begin()), itend(testset.end());
- for(int i = 0; it != itend; ++i){
- BOOST_TEST(&*it == &values[i]);
- it = testset.erase(it);
+ {
+ iterator it(testset.begin()), itend(testset.end());
+ for(int i = 0; it != itend; ++i){
+ BOOST_TEST(&*it == &values[i]);
+ it = testset.erase(it);
+ }
}
BOOST_TEST(testset.empty());
Modified: branches/release/libs/intrusive/test/generic_multiset_test.hpp
==============================================================================
--- branches/release/libs/intrusive/test/generic_multiset_test.hpp (original)
+++ branches/release/libs/intrusive/test/generic_multiset_test.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -233,7 +233,7 @@
cmp_val_lower.value_ = 1;
cmp_val_upper.value_ = 2;
//left-closed, right-closed
- std::pair<iterator,iterator> range = testset.bounded_range (cmp_val_lower, cmp_val_upper, true, true);
+ range = testset.bounded_range (cmp_val_lower, cmp_val_upper, true, true);
BOOST_TEST (range.first->value_ == 1);
BOOST_TEST (range.second->value_ == 3);
BOOST_TEST (std::distance (range.first, range.second) == 3);
Modified: branches/release/libs/intrusive/test/generic_set_test.hpp
==============================================================================
--- branches/release/libs/intrusive/test/generic_set_test.hpp (original)
+++ branches/release/libs/intrusive/test/generic_set_test.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -305,7 +305,7 @@
cmp_val_lower.value_ = 1;
cmp_val_upper.value_ = 2;
//left-closed, right-closed
- std::pair<iterator,iterator> range = testset.bounded_range (cmp_val_lower, cmp_val_upper, true, true);
+ range = testset.bounded_range (cmp_val_lower, cmp_val_upper, true, true);
BOOST_TEST (range.first->value_ == 1);
BOOST_TEST (range.second->value_ == 3);
BOOST_TEST (std::distance (range.first, range.second) == 2);
Modified: branches/release/libs/intrusive/test/pointer_traits_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/pointer_traits_test.cpp (original)
+++ branches/release/libs/intrusive/test/pointer_traits_test.cpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -20,7 +20,7 @@
public:
- #if !defined(BOOST_NO_TEMPLATE_ALIASES)
+ #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
template <class U> using rebind = CompleteSmartPtr<U>;
#else
template <class U> struct rebind
Modified: branches/release/libs/intrusive/test/stateful_value_traits_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/stateful_value_traits_test.cpp (original)
+++ branches/release/libs/intrusive/test/stateful_value_traits_test.cpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -53,8 +53,8 @@
static const link_mode_type link_mode = normal_link;
- stateful_value_traits(pointer values, node_ptr node_array)
- : values_(values), node_array_(node_array)
+ stateful_value_traits(pointer vals, node_ptr node_array)
+ : values_(vals), node_array_(node_array)
{}
node_ptr to_node_ptr (value_type &value)
Modified: branches/release/libs/intrusive/test/test_container.hpp
==============================================================================
--- branches/release/libs/intrusive/test/test_container.hpp (original)
+++ branches/release/libs/intrusive/test/test_container.hpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -111,9 +111,9 @@
BOOST_TEST( !c.empty() );
{
- typename Data::iterator i = d.begin();
- ++++i;
- c.insert( c.begin(), *(i) );
+ typename Data::iterator di = d.begin();
+ ++++di;
+ c.insert( c.begin(), *(di) );
}
i = c.erase( c.begin(), c.end() );
@@ -361,10 +361,14 @@
std::pair<const_iterator, const_iterator> er = c.equal_range(*di);
size_type cnt = std::distance(er.first, er.second);
BOOST_TEST( cnt == c.count(*di));
- if(cnt > 1)
- for(const_iterator n = er.first, i = n++, e = er.second; n != e; ++i, ++n){
- BOOST_TEST( c.key_eq()(*i, *n) );
- BOOST_TEST( c.hash_function()(*i) == c.hash_function()(*n) );
+ if(cnt > 1){
+ const_iterator n = er.first;
+ i = n++;
+ const_iterator e = er.second;
+ for(; n != e; ++i, ++n){
+ BOOST_TEST( c.key_eq()(*i, *n) );
+ BOOST_TEST( c.hash_function()(*i) == c.hash_function()(*n) );
+ }
}
}
Modified: branches/release/libs/intrusive/test/unordered_multiset_test.cpp
==============================================================================
--- branches/release/libs/intrusive/test/unordered_multiset_test.cpp (original)
+++ branches/release/libs/intrusive/test/unordered_multiset_test.cpp 2012-12-01 17:56:12 EST (Sat, 01 Dec 2012)
@@ -212,118 +212,120 @@
> unordered_multiset_type;
typedef typename unordered_multiset_type::bucket_traits bucket_traits;
typedef typename unordered_multiset_type::iterator iterator;
- typename unordered_multiset_type::bucket_type buckets [BucketSize];
- unordered_multiset_type testset(bucket_traits(
- pointer_traits<typename unordered_multiset_type::bucket_ptr>::
- pointer_to(buckets[0]), BucketSize));
-
- testset.insert(&values[0] + 2, &values[0] + 5);
-
- const unordered_multiset_type& const_testset = testset;
-
- if(Incremental){
- {
- { int init_values [] = { 4, 5, 1 };
- TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
-
- typename unordered_multiset_type::iterator i = testset.begin();
- BOOST_TEST (i->value_ == 4);
+ {
+ typename unordered_multiset_type::bucket_type buckets [BucketSize];
+ unordered_multiset_type testset(bucket_traits(
+ pointer_traits<typename unordered_multiset_type::bucket_ptr>::
+ pointer_to(buckets[0]), BucketSize));
- i = testset.insert (values[0]);
- BOOST_TEST (&*i == &values[0]);
+ testset.insert(&values[0] + 2, &values[0] + 5);
- i = testset.iterator_to (values[2]);
- BOOST_TEST (&*i == &values[2]);
- testset.erase(i);
-
- { int init_values [] = { 5, 1, 3 };
- TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
- testset.clear();
- testset.insert(&values[0], &values[0] + values.size());
-
- { int init_values [] = { 4, 5, 1, 2, 2, 3 };
- TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
-
- BOOST_TEST (testset.erase(1) == 1);
- BOOST_TEST (testset.erase(2) == 2);
- BOOST_TEST (testset.erase(3) == 1);
- BOOST_TEST (testset.erase(4) == 1);
- BOOST_TEST (testset.erase(5) == 1);
- BOOST_TEST (testset.empty() == true);
+ const unordered_multiset_type& const_testset = testset;
- //Now with a single bucket
- typename unordered_multiset_type::bucket_type single_bucket[1];
- unordered_multiset_type testset2(bucket_traits(
- pointer_traits<typename unordered_multiset_type::bucket_ptr>::
- pointer_to(single_bucket[0]), 1));
- testset2.insert(&values[0], &values[0] + values.size());
- BOOST_TEST (testset2.erase(5) == 1);
- BOOST_TEST (testset2.erase(2) == 2);
- BOOST_TEST (testset2.erase(1) == 1);
- BOOST_TEST (testset2.erase(4) == 1);
- BOOST_TEST (testset2.erase(3) == 1);
- BOOST_TEST (testset2.empty() == true);
+ if(Incremental){
+ {
+ { int init_values [] = { 4, 5, 1 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+
+ typename unordered_multiset_type::iterator i = testset.begin();
+ BOOST_TEST (i->value_ == 4);
+
+ i = testset.insert (values[0]);
+ BOOST_TEST (&*i == &values[0]);
+
+ i = testset.iterator_to (values[2]);
+ BOOST_TEST (&*i == &values[2]);
+ testset.erase(i);
+
+ { int init_values [] = { 5, 1, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+ testset.clear();
+ testset.insert(&values[0], &values[0] + values.size());
+
+ { int init_values [] = { 4, 5, 1, 2, 2, 3 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+
+ BOOST_TEST (testset.erase(1) == 1);
+ BOOST_TEST (testset.erase(2) == 2);
+ BOOST_TEST (testset.erase(3) == 1);
+ BOOST_TEST (testset.erase(4) == 1);
+ BOOST_TEST (testset.erase(5) == 1);
+ BOOST_TEST (testset.empty() == true);
+
+ //Now with a single bucket
+ typename unordered_multiset_type::bucket_type single_bucket[1];
+ unordered_multiset_type testset2(bucket_traits(
+ pointer_traits<typename unordered_multiset_type::bucket_ptr>::
+ pointer_to(single_bucket[0]), 1));
+ testset2.insert(&values[0], &values[0] + values.size());
+ BOOST_TEST (testset2.erase(5) == 1);
+ BOOST_TEST (testset2.erase(2) == 2);
+ BOOST_TEST (testset2.erase(1) == 1);
+ BOOST_TEST (testset2.erase(4) == 1);
+ BOOST_TEST (testset2.erase(3) == 1);
+ BOOST_TEST (testset2.empty() == true);
+ }
+ }
+ else{
+ {
+ { int init_values [] = { 1, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+
+ typename unordered_multiset_type::iterator i = testset.begin();
+ BOOST_TEST (i->value_ == 1);
+
+ i = testset.insert (values[0]);
+ BOOST_TEST (&*i == &values[0]);
+
+ i = testset.iterator_to (values[2]);
+ BOOST_TEST (&*i == &values[2]);
+ testset.erase(i);
+
+ { int init_values [] = { 1, 3, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+ testset.clear();
+ testset.insert(&values[0], &values[0] + values.size());
+
+ { int init_values [] = { 1, 2, 2, 3, 4, 5 };
+ TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
+
+ BOOST_TEST (testset.erase(1) == 1);
+ BOOST_TEST (testset.erase(2) == 2);
+ BOOST_TEST (testset.erase(3) == 1);
+ BOOST_TEST (testset.erase(4) == 1);
+ BOOST_TEST (testset.erase(5) == 1);
+ BOOST_TEST (testset.empty() == true);
+
+ //Now with a single bucket
+ typename unordered_multiset_type::bucket_type single_bucket[1];
+ unordered_multiset_type testset2(bucket_traits(
+ pointer_traits<typename unordered_multiset_type::bucket_ptr>::
+ pointer_to(single_bucket[0]), 1));
+ testset2.insert(&values[0], &values[0] + values.size());
+ BOOST_TEST (testset2.erase(5) == 1);
+ BOOST_TEST (testset2.erase(2) == 2);
+ BOOST_TEST (testset2.erase(1) == 1);
+ BOOST_TEST (testset2.erase(4) == 1);
+ BOOST_TEST (testset2.erase(3) == 1);
+ BOOST_TEST (testset2.empty() == true);
+ }
}
- }
- else{
{
- { int init_values [] = { 1, 4, 5 };
- TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
-
- typename unordered_multiset_type::iterator i = testset.begin();
- BOOST_TEST (i->value_ == 1);
-
- i = testset.insert (values[0]);
- BOOST_TEST (&*i == &values[0]);
-
- i = testset.iterator_to (values[2]);
- BOOST_TEST (&*i == &values[2]);
- testset.erase(i);
-
- { int init_values [] = { 1, 3, 5 };
- TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
- testset.clear();
- testset.insert(&values[0], &values[0] + values.size());
-
- { int init_values [] = { 1, 2, 2, 3, 4, 5 };
- TEST_INTRUSIVE_SEQUENCE( init_values, const_testset.begin() ); }
-
- BOOST_TEST (testset.erase(1) == 1);
- BOOST_TEST (testset.erase(2) == 2);
- BOOST_TEST (testset.erase(3) == 1);
- BOOST_TEST (testset.erase(4) == 1);
- BOOST_TEST (testset.erase(5) == 1);
- BOOST_TEST (testset.empty() == true);
-
- //Now with a single bucket
+ //Now erase just one per loop
+ const int random_init[] = { 3, 2, 4, 1, 5, 2, 2 };
+ const unsigned int random_size = sizeof(random_init)/sizeof(random_init[0]);
typename unordered_multiset_type::bucket_type single_bucket[1];
- unordered_multiset_type testset2(bucket_traits(
- pointer_traits<typename unordered_multiset_type::bucket_ptr>::
- pointer_to(single_bucket[0]), 1));
- testset2.insert(&values[0], &values[0] + values.size());
- BOOST_TEST (testset2.erase(5) == 1);
- BOOST_TEST (testset2.erase(2) == 2);
- BOOST_TEST (testset2.erase(1) == 1);
- BOOST_TEST (testset2.erase(4) == 1);
- BOOST_TEST (testset2.erase(3) == 1);
- BOOST_TEST (testset2.empty() == true);
- }
- }
- {
- //Now erase just one per loop
- const int random_init[] = { 3, 2, 4, 1, 5, 2, 2 };
- const unsigned int random_size = sizeof(random_init)/sizeof(random_init[0]);
- typename unordered_multiset_type::bucket_type single_bucket[1];
- for(unsigned int i = 0, max = random_size; i != max; ++i){
- std::vector<typename ValueTraits::value_type> data (random_size);
- for (unsigned int j = 0; j < random_size; ++j)
- data[j].value_ = random_init[j];
- unordered_multiset_type testset_new(bucket_traits(
- pointer_traits<typename unordered_multiset_type::bucket_ptr>::
- pointer_to(single_bucket[0]), 1));
- testset_new.insert(&data[0], &data[0]+max);
- testset_new.erase(testset_new.iterator_to(data[i]));
- BOOST_TEST (testset_new.size() == (max -1));
+ for(unsigned int i = 0, max = random_size; i != max; ++i){
+ std::vector<typename ValueTraits::value_type> data (random_size);
+ for (unsigned int j = 0; j < random_size; ++j)
+ data[j].value_ = random_init[j];
+ unordered_multiset_type testset_new(bucket_traits(
+ pointer_traits<typename unordered_multiset_type::bucket_ptr>::
+ pointer_to(single_bucket[0]), 1));
+ testset_new.insert(&data[0], &data[0]+max);
+ testset_new.erase(testset_new.iterator_to(data[i]));
+ BOOST_TEST (testset_new.size() == (max -1));
+ }
}
}
{
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