mirror of
https://github.com/boostorg/container.git
synced 2025-08-02 14:04:26 +02:00
refs #7531 (variable shadowing in container and intrusive)
[SVN r81050]
This commit is contained in:
@@ -446,11 +446,11 @@ class flat_tree
|
||||
//Loop in burst sizes
|
||||
while(len){
|
||||
const size_type burst = len < BurstSize ? len : BurstSize;
|
||||
const const_iterator cend(this->cend());
|
||||
const const_iterator cend_(this->cend());
|
||||
len -= burst;
|
||||
for(size_type i = 0; i != burst; ++i){
|
||||
//Get the insertion position for each key
|
||||
pos = const_cast<const flat_tree&>(*this).priv_upper_bound(pos, cend, KeyOfValue()(*first));
|
||||
pos = const_cast<const flat_tree&>(*this).priv_upper_bound(pos, cend_, KeyOfValue()(*first));
|
||||
positions[i] = static_cast<size_type>(pos - beg);
|
||||
++first;
|
||||
}
|
||||
@@ -497,14 +497,14 @@ class flat_tree
|
||||
while(len){
|
||||
const size_type burst = len < BurstSize ? len : BurstSize;
|
||||
size_type unique_burst = 0u;
|
||||
const const_iterator cend(this->cend());
|
||||
const const_iterator cend_(this->cend());
|
||||
while(unique_burst < burst && len > 0){
|
||||
//Get the insertion position for each key
|
||||
const value_type & val = *first++;
|
||||
--len;
|
||||
pos = const_cast<const flat_tree&>(*this).priv_lower_bound(pos, cend, KeyOfValue()(val));
|
||||
pos = const_cast<const flat_tree&>(*this).priv_lower_bound(pos, cend_, KeyOfValue()(val));
|
||||
//Check if already present
|
||||
if(pos != cend && !value_comp(val, *pos)){
|
||||
if(pos != cend_ && !value_comp(val, *pos)){
|
||||
if(unique_burst > 0){
|
||||
++skips[unique_burst-1];
|
||||
}
|
||||
@@ -692,10 +692,10 @@ class flat_tree
|
||||
// set operations:
|
||||
iterator find(const key_type& k)
|
||||
{
|
||||
const Compare &key_comp = this->m_data.get_comp();
|
||||
const Compare &key_comp_ = this->m_data.get_comp();
|
||||
iterator i = this->lower_bound(k);
|
||||
|
||||
if (i != this->end() && key_comp(k, KeyOfValue()(*i))){
|
||||
if (i != this->end() && key_comp_(k, KeyOfValue()(*i))){
|
||||
i = this->end();
|
||||
}
|
||||
return i;
|
||||
@@ -703,10 +703,10 @@ class flat_tree
|
||||
|
||||
const_iterator find(const key_type& k) const
|
||||
{
|
||||
const Compare &key_comp = this->m_data.get_comp();
|
||||
const Compare &key_comp_ = this->m_data.get_comp();
|
||||
const_iterator i = this->lower_bound(k);
|
||||
|
||||
if (i != this->end() && key_comp(k, KeyOfValue()(*i))){
|
||||
if (i != this->end() && key_comp_(k, KeyOfValue()(*i))){
|
||||
i = this->end();
|
||||
}
|
||||
return i;
|
||||
@@ -740,8 +740,8 @@ class flat_tree
|
||||
size_type capacity() const
|
||||
{ return this->m_data.m_vect.capacity(); }
|
||||
|
||||
void reserve(size_type count)
|
||||
{ this->m_data.m_vect.reserve(count); }
|
||||
void reserve(size_type count_)
|
||||
{ this->m_data.m_vect.reserve(count_); }
|
||||
|
||||
private:
|
||||
struct insert_commit_data
|
||||
@@ -780,13 +780,13 @@ class flat_tree
|
||||
}
|
||||
|
||||
std::pair<iterator,bool> priv_insert_unique_prepare
|
||||
(const_iterator beg, const_iterator end, const value_type& val, insert_commit_data &commit_data)
|
||||
(const_iterator beg, const_iterator end_, const value_type& val, insert_commit_data &commit_data)
|
||||
{
|
||||
const value_compare &value_comp = this->m_data;
|
||||
commit_data.position = this->priv_lower_bound(beg, end, KeyOfValue()(val));
|
||||
commit_data.position = this->priv_lower_bound(beg, end_, KeyOfValue()(val));
|
||||
return std::pair<iterator,bool>
|
||||
( *reinterpret_cast<iterator*>(&commit_data.position)
|
||||
, commit_data.position == end || value_comp(val, *commit_data.position));
|
||||
, commit_data.position == end_ || value_comp(val, *commit_data.position));
|
||||
}
|
||||
|
||||
std::pair<iterator,bool> priv_insert_unique_prepare
|
||||
@@ -854,7 +854,7 @@ class flat_tree
|
||||
RanIt priv_lower_bound(RanIt first, RanIt last,
|
||||
const key_type & key) const
|
||||
{
|
||||
const Compare &key_comp = this->m_data.get_comp();
|
||||
const Compare &key_comp_ = this->m_data.get_comp();
|
||||
KeyOfValue key_extract;
|
||||
difference_type len = last - first, half;
|
||||
RanIt middle;
|
||||
@@ -864,7 +864,7 @@ class flat_tree
|
||||
middle = first;
|
||||
middle += half;
|
||||
|
||||
if (key_comp(key_extract(*middle), key)) {
|
||||
if (key_comp_(key_extract(*middle), key)) {
|
||||
++middle;
|
||||
first = middle;
|
||||
len = len - half - 1;
|
||||
@@ -879,7 +879,7 @@ class flat_tree
|
||||
RanIt priv_upper_bound(RanIt first, RanIt last,
|
||||
const key_type & key) const
|
||||
{
|
||||
const Compare &key_comp = this->m_data.get_comp();
|
||||
const Compare &key_comp_ = this->m_data.get_comp();
|
||||
KeyOfValue key_extract;
|
||||
difference_type len = last - first, half;
|
||||
RanIt middle;
|
||||
@@ -889,7 +889,7 @@ class flat_tree
|
||||
middle = first;
|
||||
middle += half;
|
||||
|
||||
if (key_comp(key, key_extract(*middle))) {
|
||||
if (key_comp_(key, key_extract(*middle))) {
|
||||
len = half;
|
||||
}
|
||||
else{
|
||||
@@ -904,7 +904,7 @@ class flat_tree
|
||||
std::pair<RanIt, RanIt>
|
||||
priv_equal_range(RanIt first, RanIt last, const key_type& key) const
|
||||
{
|
||||
const Compare &key_comp = this->m_data.get_comp();
|
||||
const Compare &key_comp_ = this->m_data.get_comp();
|
||||
KeyOfValue key_extract;
|
||||
difference_type len = last - first, half;
|
||||
RanIt middle, left, right;
|
||||
@@ -914,12 +914,12 @@ class flat_tree
|
||||
middle = first;
|
||||
middle += half;
|
||||
|
||||
if (key_comp(key_extract(*middle), key)){
|
||||
if (key_comp_(key_extract(*middle), key)){
|
||||
first = middle;
|
||||
++first;
|
||||
len = len - half - 1;
|
||||
}
|
||||
else if (key_comp(key, key_extract(*middle))){
|
||||
else if (key_comp_(key, key_extract(*middle))){
|
||||
len = half;
|
||||
}
|
||||
else {
|
||||
|
@@ -126,22 +126,22 @@ class basic_multiallocation_chain
|
||||
return ret;
|
||||
}
|
||||
|
||||
void splice_after(iterator after_this, basic_multiallocation_chain &x, iterator before_begin, iterator before_end)
|
||||
{ slist_impl_.splice_after(after_this, x.slist_impl_, before_begin, before_end); }
|
||||
void splice_after(iterator after_this, basic_multiallocation_chain &x, iterator before_begin_, iterator before_end)
|
||||
{ slist_impl_.splice_after(after_this, x.slist_impl_, before_begin_, before_end); }
|
||||
|
||||
void splice_after(iterator after_this, basic_multiallocation_chain &x, iterator before_begin, iterator before_end, size_type n)
|
||||
{ slist_impl_.splice_after(after_this, x.slist_impl_, before_begin, before_end, n); }
|
||||
void splice_after(iterator after_this, basic_multiallocation_chain &x, iterator before_begin_, iterator before_end, size_type n)
|
||||
{ slist_impl_.splice_after(after_this, x.slist_impl_, before_begin_, before_end, n); }
|
||||
|
||||
void splice_after(iterator after_this, basic_multiallocation_chain &x)
|
||||
{ slist_impl_.splice_after(after_this, x.slist_impl_); }
|
||||
|
||||
void incorporate_after(iterator after_this, void_pointer begin , iterator before_end)
|
||||
void incorporate_after(iterator after_this, void_pointer begin_ , iterator before_end)
|
||||
{
|
||||
slist_impl_.incorporate_after(after_this, to_node_ptr(begin), to_node_ptr(before_end));
|
||||
slist_impl_.incorporate_after(after_this, to_node_ptr(begin_), to_node_ptr(before_end));
|
||||
}
|
||||
|
||||
void incorporate_after(iterator after_this, void_pointer begin, void_pointer before_end, size_type n)
|
||||
{ slist_impl_.incorporate_after(after_this, to_node_ptr(begin), to_node_ptr(before_end), n); }
|
||||
void incorporate_after(iterator after_this, void_pointer begin_, void_pointer before_end, size_type n)
|
||||
{ slist_impl_.incorporate_after(after_this, to_node_ptr(begin_), to_node_ptr(before_end), n); }
|
||||
|
||||
void swap(basic_multiallocation_chain &x)
|
||||
{ slist_impl_.swap(x.slist_impl_); }
|
||||
@@ -217,11 +217,11 @@ class transform_multiallocation_chain
|
||||
void swap(transform_multiallocation_chain &other_chain)
|
||||
{ holder_.swap(other_chain.holder_); }
|
||||
|
||||
void splice_after(iterator after_this, transform_multiallocation_chain &x, iterator before_begin, iterator before_end, size_type n)
|
||||
{ holder_.splice_after(after_this.base(), x.holder_, before_begin.base(), before_end.base(), n); }
|
||||
void splice_after(iterator after_this, transform_multiallocation_chain &x, iterator before_begin_, iterator before_end, size_type n)
|
||||
{ holder_.splice_after(after_this.base(), x.holder_, before_begin_.base(), before_end.base(), n); }
|
||||
|
||||
void incorporate_after(iterator after_this, pointer begin, pointer before_end, size_type n)
|
||||
{ holder_.incorporate_after(after_this.base(), begin, before_end, n); }
|
||||
void incorporate_after(iterator after_this, pointer begin_, pointer before_end, size_type n)
|
||||
{ holder_.incorporate_after(after_this.base(), begin_, before_end, n); }
|
||||
|
||||
pointer pop_front()
|
||||
{ return cast(holder_.pop_front()); }
|
||||
|
@@ -430,8 +430,8 @@ class flat_map
|
||||
//!
|
||||
//! <b>Note</b>: If capacity() is less than "count", iterators and references to
|
||||
//! to values might be invalidated.
|
||||
void reserve(size_type count)
|
||||
{ m_flat_tree.reserve(count); }
|
||||
void reserve(size_type count_)
|
||||
{ m_flat_tree.reserve(count_); }
|
||||
|
||||
//! <b>Effects</b>: Tries to deallocate the excess of memory created
|
||||
// with previous allocations. The size of the vector is unchanged
|
||||
@@ -1278,8 +1278,8 @@ class flat_multimap
|
||||
//!
|
||||
//! <b>Note</b>: If capacity() is less than "count", iterators and references to
|
||||
//! to values might be invalidated.
|
||||
void reserve(size_type count)
|
||||
{ m_flat_tree.reserve(count); }
|
||||
void reserve(size_type count_)
|
||||
{ m_flat_tree.reserve(count_); }
|
||||
|
||||
//! <b>Effects</b>: Tries to deallocate the excess of memory created
|
||||
// with previous allocations. The size of the vector is unchanged
|
||||
|
@@ -377,8 +377,8 @@ class flat_set
|
||||
//!
|
||||
//! <b>Note</b>: If capacity() is less than "count", iterators and references to
|
||||
//! to values might be invalidated.
|
||||
void reserve(size_type count)
|
||||
{ m_flat_tree.reserve(count); }
|
||||
void reserve(size_type count_)
|
||||
{ m_flat_tree.reserve(count_); }
|
||||
|
||||
//! <b>Effects</b>: Tries to deallocate the excess of memory created
|
||||
// with previous allocations. The size of the vector is unchanged
|
||||
@@ -1057,8 +1057,8 @@ class flat_multiset
|
||||
//!
|
||||
//! <b>Note</b>: If capacity() is less than "count", iterators and references to
|
||||
//! to values might be invalidated.
|
||||
void reserve(size_type count)
|
||||
{ m_flat_tree.reserve(count); }
|
||||
void reserve(size_type count_)
|
||||
{ m_flat_tree.reserve(count_); }
|
||||
|
||||
//! <b>Effects</b>: Tries to deallocate the excess of memory created
|
||||
// with previous allocations. The size of the vector is unchanged
|
||||
|
@@ -951,9 +951,9 @@ class multimap
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear in N.
|
||||
template <class InputIterator>
|
||||
multimap(ordered_range_t ordered_range, InputIterator first, InputIterator last, const Compare& comp = Compare(),
|
||||
multimap(ordered_range_t ordered_range_, InputIterator first, InputIterator last, const Compare& comp = Compare(),
|
||||
const allocator_type& a = allocator_type())
|
||||
: m_tree(ordered_range, first, last, comp, a)
|
||||
: m_tree(ordered_range_, first, last, comp, a)
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: Copy constructs a multimap.
|
||||
|
@@ -757,10 +757,10 @@ class multiset
|
||||
//!
|
||||
//! <b>Complexity</b>: Linear in N.
|
||||
template <class InputIterator>
|
||||
multiset( ordered_range_t ordered_range, InputIterator first, InputIterator last
|
||||
multiset( ordered_range_t ordered_range_, InputIterator first, InputIterator last
|
||||
, const Compare& comp = Compare()
|
||||
, const allocator_type& a = allocator_type())
|
||||
: m_tree(ordered_range, first, last, comp, a)
|
||||
: m_tree(ordered_range_, first, last, comp, a)
|
||||
{}
|
||||
|
||||
//! <b>Effects</b>: Copy constructs a multiset.
|
||||
|
@@ -1094,7 +1094,7 @@ class stable_vector
|
||||
if(n > this->max_size())
|
||||
throw std::bad_alloc();
|
||||
|
||||
size_type size = this->size();
|
||||
size_type size_ = this->size();
|
||||
size_type old_capacity = this->capacity();
|
||||
if(n > old_capacity){
|
||||
index_traits_type::initialize_end_node(this->index, this->internal_data.end_node, n);
|
||||
@@ -1106,8 +1106,8 @@ class stable_vector
|
||||
index_traits_type::fix_up_pointers_from(this->index, this->index.begin());
|
||||
}
|
||||
//Now fill pool if data is not enough
|
||||
if((n - size) > this->internal_data.pool_size){
|
||||
this->priv_increase_pool((n - size) - this->internal_data.pool_size);
|
||||
if((n - size_) > this->internal_data.pool_size){
|
||||
this->priv_increase_pool((n - size_) - this->internal_data.pool_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1322,10 +1322,10 @@ class basic_string
|
||||
//! <b>Returns</b>: *this
|
||||
basic_string& insert(size_type pos, const basic_string& s)
|
||||
{
|
||||
const size_type size = this->size();
|
||||
if (pos > size)
|
||||
const size_type size_ = this->size();
|
||||
if (pos > size_)
|
||||
this->throw_out_of_range();
|
||||
if (size > this->max_size() - s.size())
|
||||
if (size_ > this->max_size() - s.size())
|
||||
this->throw_length_error();
|
||||
this->insert(this->priv_addr() + pos, s.begin(), s.end());
|
||||
return *this;
|
||||
@@ -1341,12 +1341,12 @@ class basic_string
|
||||
//! <b>Returns</b>: *this
|
||||
basic_string& insert(size_type pos1, const basic_string& s, size_type pos2, size_type n)
|
||||
{
|
||||
const size_type size = this->size();
|
||||
const size_type size_ = this->size();
|
||||
const size_type str_size = s.size();
|
||||
if (pos1 > size || pos2 > str_size)
|
||||
if (pos1 > size_ || pos2 > str_size)
|
||||
this->throw_out_of_range();
|
||||
size_type len = container_detail::min_value(n, str_size - pos2);
|
||||
if (size > this->max_size() - len)
|
||||
if (size_ > this->max_size() - len)
|
||||
this->throw_length_error();
|
||||
const CharT *beg_ptr = container_detail::to_raw_pointer(s.begin()) + pos2;
|
||||
const CharT *end_ptr = beg_ptr + len;
|
||||
@@ -1949,12 +1949,12 @@ class basic_string
|
||||
//! <b>Returns</b>: find(basic_string<CharT,traits,Allocator>(1,c), pos).
|
||||
size_type find(CharT c, size_type pos = 0) const
|
||||
{
|
||||
const size_type size = this->size();
|
||||
if (pos >= size)
|
||||
const size_type size_ = this->size();
|
||||
if (pos >= size_)
|
||||
return npos;
|
||||
else {
|
||||
const pointer addr = this->priv_addr();
|
||||
pointer finish = addr + size;
|
||||
const pointer addr = this->priv_addr();
|
||||
pointer finish = addr + size_;
|
||||
const const_iterator result =
|
||||
std::find_if(addr + pos, finish,
|
||||
std::bind2nd(Eq_traits<Traits>(), c));
|
||||
@@ -2039,12 +2039,12 @@ class basic_string
|
||||
//! <b>Returns</b>: find_first_of(basic_string(s, n), pos).
|
||||
size_type find_first_of(const CharT* s, size_type pos, size_type n) const
|
||||
{
|
||||
const size_type size = this->size();
|
||||
if (pos >= size)
|
||||
const size_type size_ = this->size();
|
||||
if (pos >= size_)
|
||||
return npos;
|
||||
else {
|
||||
const pointer addr = this->priv_addr();
|
||||
pointer finish = addr + size;
|
||||
const pointer addr = this->priv_addr();
|
||||
pointer finish = addr + size_;
|
||||
const_iterator result = std::find_first_of
|
||||
(addr + pos, finish, s, s + n, Eq_traits<Traits>());
|
||||
return result != finish ? result - this->begin() : npos;
|
||||
|
Reference in New Issue
Block a user