diff --git a/doc/circular_buffer.html b/doc/circular_buffer.html
index 6362489..d649dd7 100644
--- a/doc/circular_buffer.html
+++ b/doc/circular_buffer.html
@@ -1489,6 +1489,14 @@ template <class T, class Alloc>
Invalidates all iterators pointing to the circular_buffer.
+
clear()
+ circular_buffer; does not invalidate any
- iterator if the postcondition is already met prior calling this method.
+ iterators if the postcondition is already met prior calling this method.
circular_buffers.
+ this contains elements of cb and vice versa.
+ cb The circular_buffer whose content should be swapped.
+ cb The circular_buffer whose content will be swapped.
this contains elements of cb and vice versa.
- circular_buffer.
(*this).back() ==
- itemcapacity()
+ > 0 then back() == itemcircular_buffer is full, the first (leftmost) element will be removed. If the
+ capacity is 0, nothing will be inserted.
+ item The element to be inserted.
circular_buffer).
+ push_front(),
+ pop_back(),
+ pop_front()
circular_buffer.
(*this).front()
- == itemcapacity()
+ > 0 then front() == itemcircular_buffer is full, the last (rightmost) element will be removed. If the
+ capacity is 0, nothing will be inserted.
+ item The element to be inserted.
circular_buffer).
+ push_back(),
+ pop_back(),
+ pop_front()
void
pop_back();circular_buffer.
!*(this).empty() iterator
- it = ((*this).end() -
- 1)
+ !empty()
((*this).end() -
- 1) != it
+ The last (rightmost) element is removed from the circular_buffer.
circular_buffer).
+ pop_front(),
+ push_back(),
+ push_front()
void
pop_front();circular_buffer.
!*(this).empty() iterator
- it = (*this).begin()
+ !empty()
(*this).begin()
- != it
+ The first (leftmost) element is removed from the circular_buffer.
circular_buffer).
+ pop_back(),
+ push_back(),
+ push_front()
pos iterator. size_type old_size = (*this).size()
+ pos is a valid iterator.
(*this).size() ==
- old_size - 1pos.
+ The element at the position pos is removed.
(*this).end() if no such element
exists.
circular_buffer).
+ erase(iterator,
+ iterator), rerase(iterator),
+ rerase(iterator,
+ iterator), clear()
[first, last). size_type old_size = (*this).size()
+ Valid range [first, last).
(*this).size() ==
- old_size - std::distance(first, last)[first, last).
+ The elements from the range [first, last) are removed.
(*this).end() if no such element
exists.
circular_buffer).
+ erase(iterator),
+ rerase(iterator),
+ rerase(iterator,
+ iterator), clear()
pos iterator. size_type old_size = (*this).size()
+ pos is a valid iterator.
(*this).size() ==
- old_size - 1pos.
+ The element at the position pos is removed.
(*this).begin() if no such
element exists.
circular_buffer).
+ erase(iterator),
+ erase(iterator,
+ iterator), rerase(iterator,
+ iterator), clear()
[first, last). size_type old_size = (*this).size()
+ Valid range [first, last).
(*this).size() ==
- old_size - std::distance(first, last)[first, last).
+ The elements from the range [first, last) are removed.
(*this).begin() if no such
element exists.
circular_buffer).
+ erase(iterator),
+ erase(iterator,
+ iterator), rerase(iterator),
+ clear()
void
clear();circular_buffer.
size() ==
+ 0
circular_buffer).
+ circular_buffer.
+ ~circular_buffer(),
+ erase(iterator),
+ erase(iterator,
+ iterator), rerase(iterator),
+ rerase(iterator,
+ iterator)
get_allocator() for obtaining an allocator %reference.
*/
allocator_type get_allocator() const { return m_alloc; }
@@ -197,7 +197,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\note This method was added in order to optimize obtaining of the allocator with a state,
although use of stateful allocators in STL is discouraged.
\sa get_allocator() const
@@ -217,7 +217,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa end(), rbegin(), rend()
*/
iterator begin() { return iterator(this, empty() ? 0 : m_first); }
@@ -233,7 +233,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa begin(), rbegin(), rend()
*/
iterator end() { return iterator(this, 0); }
@@ -249,7 +249,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa end() const, rbegin() const, rend() const
*/
const_iterator begin() const { return const_iterator(this, empty() ? 0 : m_first); }
@@ -265,7 +265,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa begin() const, rbegin() const, rend() const
*/
const_iterator end() const { return const_iterator(this, 0); }
@@ -281,7 +281,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa rend(), begin(), end()
*/
reverse_iterator rbegin() { return reverse_iterator(end()); }
@@ -297,7 +297,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa rbegin(), begin(), end()
*/
reverse_iterator rend() { return reverse_iterator(begin()); }
@@ -313,7 +313,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa rend() const, begin() const, end() const
*/
const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
@@ -329,7 +329,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa rbegin() const, begin() const, end() const
*/
const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
@@ -345,7 +345,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa at()
*/
reference operator [] (size_type index) {
@@ -364,7 +364,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa \link at(size_type)const at() const \endlink
*/
return_value_type operator [] (size_type index) const {
@@ -382,7 +382,7 @@ public:
\par Exception Safety
Strong.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa operator[]
*/
reference at(size_type index) {
@@ -400,7 +400,7 @@ public:
\par Exception Safety
Strong.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa \link operator[](size_type)const operator[] const \endlink
*/
return_value_type at(size_type index) const {
@@ -418,7 +418,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa back()
*/
reference front() {
@@ -436,7 +436,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa front()
*/
reference back() {
@@ -454,7 +454,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa back() const
*/
return_value_type front() const {
@@ -472,7 +472,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa front() const
*/
return_value_type back() const {
@@ -516,7 +516,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\warning In general invoking any method which modifies the internal state of the circular_buffer may
delinearize the internal buffer and invalidate the array ranges returned by array_one()
and array_two() (and their const versions).
@@ -542,7 +542,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa array_one()
*/
array_range array_two() {
@@ -561,7 +561,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa array_two() const; array_one() for more details.how to pass data into a legacy C
API.
*/
@@ -582,7 +582,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa array_one() const
*/
const_array_range array_two() const {
@@ -601,7 +601,7 @@ public:
\par Exception Safety
Basic; no-throw if the operations in the Throws section do not throw anything.
\par Iterator Invalidation
- Invalidates all iterators pointing to the circular_buffer; does not invalidate any iterator
+ Invalidates all iterators pointing to the circular_buffer; does not invalidate any iterators
if the postcondition is already met prior calling this method.
\warning In general invoking any method which modifies the internal state of the circular_buffer
may delinearize the internal buffer and invalidate the returned pointer.
@@ -662,7 +662,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa capacity(), max_size(), resize()
*/
size_type size() const { return m_size; }
@@ -676,7 +676,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa size(), capacity()
*/
size_type max_size() const {
@@ -693,7 +693,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa full()
*/
bool empty() const { return size() == 0; }
@@ -708,7 +708,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa empty()
*/
bool full() const { return size() == capacity(); }
@@ -722,7 +722,7 @@ public:
\par Exception Safety
No-throw.
\par Iterator Invalidation
- Does not invalidate any iterator.
+ Does not invalidate any iterators.
\sa size(), max_size(), set_capacity()
*/
size_type capacity() const { return m_end - m_buff; }
@@ -1051,6 +1051,7 @@ public:
No-throw.
\par Iterator Invalidation
Invalidates all iterators pointing to the circular_buffer.
+ \sa clear()
*/
~circular_buffer() { destroy(); }
@@ -1216,9 +1217,9 @@ public:
//! Swap the contents of two circular_buffers.
/*!
- \param cb The circular_buffer whose content should be swapped.
- \throws Nothing.
\post this contains elements of cb and vice versa.
+ \param cb The circular_buffer whose content will be swapped.
+ \throws Nothing.
\par Complexity
Constant (in the size of the circular_buffer).
\par Exception Safety
@@ -1245,12 +1246,20 @@ public:
// push and pop
- //! Insert a new element at the end.
+ //! Insert a new element at the end of the circular_buffer.
/*!
- \post (*this).back() == itemcapacity() > 0 then back() == itemcircular_buffer is full, the first (leftmost) element will be removed. If the
+ capacity is 0, nothing will be inserted.
+ \param item The element to be inserted.
\throws Whatever T::T(const T&) throws.
- \note For iterator invalidation see the documentation.
+ \par Complexity
+ Constant (in the size of the circular_buffer).
+ \par Exception Safety
+ Basic; no-throw if the operation in the Throws section do not throw anything.
+ \par Iterator Invalidation
+ Does not invalidate any iterators with the exception of iterators pointing to the overwritten element.
+ \sa push_front(), pop_back(), pop_front()
*/
void push_back(param_value_type item = value_type()) {
if (full()) {
@@ -1266,12 +1275,20 @@ public:
}
}
- //! Insert a new element at the start.
+ //! Insert a new element at the beginning of the circular_buffer.
/*!
- \post (*this).front() == itemcapacity() > 0 then front() == itemcircular_buffer is full, the last (rightmost) element will be removed. If the
+ capacity is 0, nothing will be inserted.
+ \param item The element to be inserted.
\throws Whatever T::T(const T&) throws.
- \note For iterator invalidation see the documentation.
+ \par Complexity
+ Constant (in the size of the circular_buffer).
+ \par Exception Safety
+ Basic; no-throw if the operation in the Throws section do not throw anything.
+ \par Iterator Invalidation
+ Does not invalidate any iterators with the exception of iterators pointing to the overwritten element.
+ \sa push_back(), pop_back(), pop_front()
*/
void push_front(param_value_type item = value_type()) {
BOOST_TRY {
@@ -1293,12 +1310,18 @@ public:
BOOST_CATCH_END
}
- //! Remove the last (rightmost) element.
+ //! Remove the last (rightmost) element from the circular_buffer.
/*!
- \pre !*(this).empty()
- \pre iterator it = ((*this).end() - 1)
- \post ((*this).end() - 1) != it
- \note For iterator invalidation see the documentation.
+ \pre !empty()
+ \post The last (rightmost) element is removed from the circular_buffer.
+ \throws Nothing.
+ \par Complexity
+ Constant (in the size of the circular_buffer).
+ \par Exception Safety
+ No-throw.
+ \par Iterator Invalidation
+ Invalidates only iterators pointing to the removed element.
+ \sa pop_front(), push_back(), push_front()
*/
void pop_back() {
BOOST_CB_ASSERT(!empty()); // check for empty buffer (back element not available)
@@ -1307,12 +1330,18 @@ public:
--m_size;
}
- //! Remove the first (leftmost) element.
+ //! Remove the first (leftmost) element from the circular_buffer.
/*!
- \pre !*(this).empty()
- \pre iterator it = (*this).begin()
- \post (*this).begin() != it
- \note For iterator invalidation see the documentation.
+ \pre !empty()
+ \post The first (leftmost) element is removed from the circular_buffer.
+ \throws Nothing.
+ \par Complexity
+ Constant (in the size of the circular_buffer).
+ \par Exception Safety
+ No-throw.
+ \par Iterator Invalidation
+ Invalidates only iterators pointing to the removed element.
+ \sa pop_back(), push_back(), push_front()
*/
void pop_front() {
BOOST_CB_ASSERT(!empty()); // check for empty buffer (front element not available)
@@ -1510,15 +1539,22 @@ public:
// Erase
- //! Erase the element at the specified position.
+ //! Remove an element at the specified position.
/*!
- \pre Valid pos iterator.
- \pre size_type old_size = (*this).size()
- \post (*this).size() == old_size - 1pos.
- \return iterator to the first element remaining beyond the removed
- element or (*this).end() if no such element exists.
- \note For iterator invalidation see the documentation.
+ \pre pos is a valid iterator.
+ \post The element at the position pos is removed.
+ \return Iterator to the first element remaining beyond the removed element or end() if no such
+ element exists.
+ \throws Whatever T::operator = (const T&) throws.
+ \par Complexity
+ Linear (in the size of the circular_buffer).
+ \par Exception Safety
+ Basic; no-throw if the operation in the Throws section does not throw anything.
+ \par Iterator Invalidation
+ Invalidates iterators pointing to the erased element and iterators pointing to the elements behind (to
+ the right from) the erased element.
+ \sa erase(iterator, iterator), rerase(iterator),
+ rerase(iterator, iterator), clear()
*/
iterator erase(iterator pos) {
BOOST_CB_ASSERT(pos.is_valid()); // check for uninitialized or invalidated iterator
@@ -1540,12 +1576,19 @@ public:
//! Erase the range [first, last).
/*!
\pre Valid range [first, last).
- \pre size_type old_size = (*this).size()
- \post (*this).size() == old_size - std::distance(first, last)[first, last).
- \return iterator to the first element remaining beyond the removed
- element or (*this).end() if no such element exists.
- \note For iterator invalidation see the documentation.
+ \post The elements from the range [first, last) are removed.
+ \return Iterator to the first element remaining beyond the removed elements or end() if no such
+ element exists.
+ \throws Whatever T::operator = (const T&) throws.
+ \par Complexity
+ Linear (in the size of the circular_buffer).
+ \par Exception Safety
+ Basic; no-throw if the operation in the Throws section does not throw anything.
+ \par Iterator Invalidation
+ Invalidates iterators pointing to the erased elements and iterators pointing to the elements behind (to
+ the right from) the erased range.
+ \sa erase(iterator), rerase(iterator), rerase(iterator, iterator),
+ clear()
*/
iterator erase(iterator first, iterator last) {
BOOST_CB_ASSERT(first.is_valid()); // check for uninitialized or invalidated iterator
@@ -1565,15 +1608,22 @@ public:
return m_last == p ? end() : iterator(this, p);
}
- //! Erase the element at the specified position.
+ //! Remove an element at the specified position.
/*!
- \pre Valid pos iterator.
- \pre size_type old_size = (*this).size()
- \post (*this).size() == old_size - 1pos.
- \return iterator to the first element remaining in front of the removed
- element or (*this).begin() if no such element exists.
- \note For iterator invalidation see the documentation.
+ \pre pos is a valid iterator.
+ \post The element at the position pos is removed.
+ \return Iterator to the first element remaining in front of the removed element or begin() if no
+ such element exists.
+ \throws Whatever T::operator = (const T&) throws.
+ \par Complexity
+ Linear (in the size of the circular_buffer).
+ \par Exception Safety
+ Basic; no-throw if the operation in the Throws section does not throw anything.
+ \par Iterator Invalidation
+ Invalidates iterators pointing to the erased element and iterators pointing to the elements in front of
+ (to the left from) the erased element.
+ \sa erase(iterator), erase(iterator, iterator),
+ rerase(iterator, iterator), clear()
*/
iterator rerase(iterator pos) {
BOOST_CB_ASSERT(pos.is_valid()); // check for uninitialized or invalidated iterator
@@ -1595,12 +1645,19 @@ public:
//! Erase the range [first, last).
/*!
\pre Valid range [first, last).
- \pre size_type old_size = (*this).size()
- \post (*this).size() == old_size - std::distance(first, last)[first, last).
- \return iterator to the first element remaining in front of the removed
- element or (*this).begin() if no such element exists.
- \note For iterator invalidation see the documentation.
+ \post The elements from the range [first, last) are removed.
+ \return Iterator to the first element remaining in front of the removed elements or begin() if no
+ such element exists.
+ \throws Whatever T::operator = (const T&) throws.
+ \par Complexity
+ Linear (in the size of the circular_buffer).
+ \par Exception Safety
+ Basic; no-throw if the operation in the Throws section does not throw anything.
+ \par Iterator Invalidation
+ Invalidates iterators pointing to the erased elements and iterators pointing to the elements in front of
+ (to the left from) the erased range.
+ \sa erase(iterator), erase(iterator, iterator), rerase(iterator),
+ clear()
*/
iterator rerase(iterator first, iterator last) {
BOOST_CB_ASSERT(first.is_valid()); // check for uninitialized or invalidated iterator
@@ -1627,10 +1684,18 @@ public:
return iterator(this, last.m_it);
}
- //! Erase all stored elements.
+ //! Remove all stored elements from the circular_buffer.
/*!
- \post (*this).size() == 0
- \note For iterator invalidation see the documentation.
+ \post size() == 0
+ \throws Nothing.
+ \par Complexity
+ Linear (in the size of the circular_buffer).
+ \par Exception Safety
+ No-throw.
+ \par Iterator Invalidation
+ Invalidates all iterators pointing to the circular_buffer.
+ \sa ~circular_buffer(), erase(iterator), erase(iterator, iterator),
+ rerase(iterator), rerase(iterator, iterator)
*/
void clear() {
destroy_content();