--- a/boost/circular_buffer/base.hpp 2008-08-18 01:54:04.000000000 -0700 +++ b/boost/circular_buffer/base.hpp 2009-05-14 13:38:46.000000000 -0700 @@ -1006,9 +1006,9 @@ \par Complexity Constant. */ - explicit circular_buffer(capacity_type capacity, const allocator_type& alloc = allocator_type()) + explicit circular_buffer(capacity_type in_capacity, const allocator_type& alloc = allocator_type()) : m_size(0), m_alloc(alloc) { - initialize_buffer(capacity); + initialize_buffer(in_capacity); m_first = m_last = m_buff; } @@ -1046,13 +1046,13 @@ \par Complexity Linear (in the n). */ - circular_buffer(capacity_type capacity, size_type n, param_value_type item, + circular_buffer(capacity_type in_capacity, size_type n, param_value_type item, const allocator_type& alloc = allocator_type()) : m_size(n), m_alloc(alloc) { - BOOST_CB_ASSERT(capacity >= size()); // check for capacity lower than size - initialize_buffer(capacity, item); + BOOST_CB_ASSERT(in_capacity >= size()); // check for capacity lower than size + initialize_buffer(in_capacity, item); m_first = m_buff; - m_last = capacity == n ? m_buff : m_buff + n; + m_last = in_capacity == n ? m_buff : m_buff + n; } //! The copy constructor. @@ -1145,10 +1145,10 @@ RandomAccessIterator). */ template - circular_buffer(capacity_type capacity, InputIterator first, InputIterator last, + circular_buffer(capacity_type in_capacity, InputIterator first, InputIterator last, const allocator_type& alloc = allocator_type()) : m_alloc(alloc) { - initialize(capacity, first, last, is_integral()); + initialize(in_capacity, first, last, is_integral()); } #endif // #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) @@ -1260,9 +1260,9 @@ assign(size_type, const_reference)\endlink, assign(InputIterator, InputIterator), assign(capacity_type, InputIterator, InputIterator) */ - void assign(capacity_type capacity, size_type n, param_value_type item) { - BOOST_CB_ASSERT(capacity >= n); // check for new capacity lower than n - assign_n(capacity, n, cb_details::assign_n(n, item, m_alloc)); + void assign(capacity_type in_capacity, size_type n, param_value_type item) { + BOOST_CB_ASSERT(in_capacity >= n); // check for new capacity lower than n + assign_n(in_capacity, n, cb_details::assign_n(n, item, m_alloc)); } //! Assign a copy of the range into the circular_buffer. @@ -1333,8 +1333,8 @@ assign(InputIterator, InputIterator) */ template - void assign(capacity_type capacity, InputIterator first, InputIterator last) { - assign(capacity, first, last, is_integral()); + void assign(capacity_type in_capacity, InputIterator first, InputIterator last) { + assign(in_capacity, first, last, is_integral()); } //! Swap the contents of two circular_buffers. @@ -2079,14 +2079,14 @@ } //! Initialize the internal buffer. - void initialize_buffer(capacity_type capacity) { - m_buff = allocate(capacity); - m_end = m_buff + capacity; + void initialize_buffer(capacity_type in_capacity) { + m_buff = allocate(in_capacity); + m_end = m_buff + in_capacity; } //! Initialize the internal buffer. - void initialize_buffer(capacity_type capacity, param_value_type item) { - initialize_buffer(capacity); + void initialize_buffer(capacity_type in_capacity, param_value_type item) { + initialize_buffer(in_capacity); BOOST_TRY { cb_details::uninitialized_fill_n_with_alloc(m_buff, size(), item, m_alloc); } BOOST_CATCH(...) { @@ -2135,35 +2135,35 @@ //! Specialized initialize method. template - void initialize(capacity_type capacity, IntegralType n, IntegralType item, const true_type&) { - BOOST_CB_ASSERT(capacity >= static_cast(n)); // check for capacity lower than n + void initialize(capacity_type in_capacity, IntegralType n, IntegralType item, const true_type&) { + BOOST_CB_ASSERT(in_capacity >= static_cast(n)); // check for capacity lower than n m_size = static_cast(n); - initialize_buffer(capacity, item); + initialize_buffer(in_capacity, item); m_first = m_buff; - m_last = capacity == size() ? m_buff : m_buff + size(); + m_last = in_capacity == size() ? m_buff : m_buff + size(); } //! Specialized initialize method. template - void initialize(capacity_type capacity, Iterator first, Iterator last, const false_type&) { + void initialize(capacity_type in_capacity, Iterator first, Iterator last, const false_type&) { BOOST_CB_IS_CONVERTIBLE(Iterator, value_type); // check for invalid iterator type #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581)) - initialize(capacity, first, last, BOOST_ITERATOR_CATEGORY::type()); + initialize(in_capacity, first, last, BOOST_ITERATOR_CATEGORY::type()); #else - initialize(capacity, first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY::type()); + initialize(in_capacity, first, last, BOOST_DEDUCED_TYPENAME BOOST_ITERATOR_CATEGORY::type()); #endif } //! Specialized initialize method. template - void initialize(capacity_type capacity, + void initialize(capacity_type in_capacity, InputIterator first, InputIterator last, const std::input_iterator_tag&) { - initialize_buffer(capacity); + initialize_buffer(in_capacity); m_first = m_last = m_buff; m_size = 0; - if (capacity == 0) + if (in_capacity == 0) return; while (first != last && !full()) { m_alloc.construct(m_last, *first++); @@ -2179,32 +2179,32 @@ //! Specialized initialize method. template - void initialize(capacity_type capacity, + void initialize(capacity_type in_capacity, ForwardIterator first, ForwardIterator last, const std::forward_iterator_tag&) { BOOST_CB_ASSERT(std::distance(first, last) >= 0); // check for wrong range - initialize(capacity, first, last, std::distance(first, last)); + initialize(in_capacity, first, last, std::distance(first, last)); } //! Initialize the circular buffer. template - void initialize(capacity_type capacity, + void initialize(capacity_type in_capacity, ForwardIterator first, ForwardIterator last, size_type distance) { - initialize_buffer(capacity); + initialize_buffer(in_capacity); m_first = m_buff; - if (distance > capacity) { - std::advance(first, distance - capacity); - m_size = capacity; + if (distance > in_capacity) { + std::advance(first, distance - in_capacity); + m_size = in_capacity; } else { m_size = distance; } BOOST_TRY { m_last = cb_details::uninitialized_copy_with_alloc(first, last, m_buff, m_alloc); } BOOST_CATCH(...) { - deallocate(m_buff, capacity); + deallocate(m_buff, in_capacity); BOOST_RETHROW } BOOST_CATCH_END --- a/boost/circular_buffer/details.hpp 2008-08-20 09:13:07.000000000 -0700 +++ b/boost/circular_buffer/details.hpp 2009-05-14 13:39:23.000000000 -0700 @@ -146,9 +146,9 @@ public: //! Constructor. - capacity_control(Size capacity, Size min_capacity = 0) - : m_capacity(capacity), m_min_capacity(min_capacity) { - BOOST_CB_ASSERT(capacity >= min_capacity); // check for capacity lower than min_capacity + capacity_control(Size in_capacity, Size in_min_capacity = 0) + : m_capacity(in_capacity), m_min_capacity(in_min_capacity) { + BOOST_CB_ASSERT(in_capacity >= in_min_capacity); // check for capacity lower than min_capacity } // Default copy constructor. --- a/boost/circular_buffer/space_optimized.hpp 2008-08-18 01:54:04.000000000 -0700 +++ b/boost/circular_buffer/space_optimized.hpp 2009-05-14 13:33:40.000000000 -0700 @@ -1229,8 +1229,8 @@ } //! Ensure the reserve for possible growth up. - size_type ensure_reserve(size_type new_capacity, size_type size) const { - if (size + new_capacity / 5 >= new_capacity) + size_type ensure_reserve(size_type new_capacity, size_type in_size) const { + if (in_size + new_capacity / 5 >= new_capacity) new_capacity *= 2; // ensure at least 20% reserve if (new_capacity > m_capacity_ctrl) return m_capacity_ctrl;