Space optimized circular buffer container adaptor. More...
#include <space_optimized.hpp>
Public Member Functions | |
bool | full () const BOOST_NOEXCEPT |
Is the circular_buffer_space_optimized full? More... | |
size_type | reserve () const BOOST_NOEXCEPT |
Get the maximum number of elements which can be inserted into the circular_buffer_space_optimized without overwriting any of already stored elements. More... | |
const capacity_type & | capacity () const BOOST_NOEXCEPT |
Get the capacity of the circular_buffer_space_optimized . More... | |
void | set_capacity (const capacity_type &capacity_ctrl) |
Change the capacity (and the minimal guaranteed amount of allocated memory) of the circular_buffer_space_optimized . More... | |
void | resize (size_type new_size, param_value_type item=value_type()) |
Change the size of the circular_buffer_space_optimized . More... | |
void | rset_capacity (const capacity_type &capacity_ctrl) |
Change the capacity (and the minimal guaranteed amount of allocated memory) of the circular_buffer_space_optimized . More... | |
void | rresize (size_type new_size, param_value_type item=value_type()) |
Change the size of the circular_buffer_space_optimized . More... | |
circular_buffer_space_optimized (const allocator_type &alloc=allocator_type()) BOOST_NOEXCEPT | |
Create an empty space optimized circular buffer with zero capacity. More... | |
circular_buffer_space_optimized (capacity_type capacity_ctrl, const allocator_type &alloc=allocator_type()) | |
Create an empty space optimized circular buffer with the specified capacity. More... | |
circular_buffer_space_optimized (capacity_type capacity_ctrl, param_value_type item, const allocator_type &alloc=allocator_type()) | |
Create a full space optimized circular buffer with the specified capacity filled with capacity_ctrl. More... | |
circular_buffer_space_optimized (capacity_type capacity_ctrl, size_type n, param_value_type item, const allocator_type &alloc=allocator_type()) | |
Create a space optimized circular buffer with the specified capacity filled with n copies of item . More... | |
circular_buffer_space_optimized (const circular_buffer_space_optimized< T, Alloc > &cb) | |
The copy constructor. More... | |
circular_buffer_space_optimized (circular_buffer_space_optimized< T, Alloc > &&cb) BOOST_NOEXCEPT | |
The move constructor. More... | |
template<class InputIterator > | |
circular_buffer_space_optimized (InputIterator first, InputIterator last, const allocator_type &alloc=allocator_type()) | |
Create a full space optimized circular buffer filled with a copy of the range. More... | |
template<class InputIterator > | |
circular_buffer_space_optimized (capacity_type capacity_ctrl, InputIterator first, InputIterator last, const allocator_type &alloc=allocator_type()) | |
Create a space optimized circular buffer with the specified capacity (and the minimal guaranteed amount of allocated memory) filled with a copy of the range. More... | |
circular_buffer_space_optimized < T, Alloc > & | operator= (const circular_buffer_space_optimized< T, Alloc > &cb) |
The assign operator. More... | |
circular_buffer_space_optimized < T, Alloc > & | operator= (circular_buffer_space_optimized< T, Alloc > &&cb) BOOST_NOEXCEPT |
Move assigns content of cb to *this , leaving cb empty. More... | |
void | assign (size_type n, param_value_type item) |
Assign n items into the space optimized circular buffer. More... | |
void | assign (capacity_type capacity_ctrl, size_type n, param_value_type item) |
Assign n items into the space optimized circular buffer specifying the capacity. More... | |
template<class InputIterator > | |
void | assign (InputIterator first, InputIterator last) |
Assign a copy of the range into the space optimized circular buffer. More... | |
template<class InputIterator > | |
void | assign (capacity_type capacity_ctrl, InputIterator first, InputIterator last) |
Assign a copy of the range into the space optimized circular buffer specifying the capacity. More... | |
void | swap (circular_buffer_space_optimized< T, Alloc > &cb) BOOST_NOEXCEPT |
Swap the contents of two space-optimized circular-buffers. More... | |
void | push_back (param_value_type item) |
Insert a new element at the end of the space optimized circular buffer. More... | |
void | push_back (rvalue_type item) |
Insert a new element at the end of the space optimized circular buffer. More... | |
void | push_back () |
Insert a new element at the end of the space optimized circular buffer. More... | |
void | push_front (param_value_type item) |
Insert a new element at the beginning of the space optimized circular buffer. More... | |
void | push_front (rvalue_type item) |
Insert a new element at the beginning of the space optimized circular buffer. More... | |
void | push_front () |
Insert a new element at the beginning of the space optimized circular buffer. More... | |
void | pop_back () |
Remove the last element from the space optimized circular buffer. More... | |
void | pop_front () |
Remove the first element from the space optimized circular buffer. More... | |
iterator | insert (iterator pos, param_value_type item) |
Insert an element at the specified position. More... | |
iterator | insert (iterator pos, rvalue_type item) |
Insert an element at the specified position. More... | |
iterator | insert (iterator pos) |
Insert an element at the specified position. More... | |
void | insert (iterator pos, size_type n, param_value_type item) |
Insert n copies of the item at the specified position. More... | |
template<class InputIterator > | |
void | insert (iterator pos, InputIterator first, InputIterator last) |
Insert the range [first, last) at the specified position. More... | |
iterator | rinsert (iterator pos, param_value_type item) |
Insert an element before the specified position. More... | |
iterator | rinsert (iterator pos, rvalue_type item) |
Insert an element before the specified position. More... | |
iterator | rinsert (iterator pos) |
Insert an element before the specified position. More... | |
void | rinsert (iterator pos, size_type n, param_value_type item) |
Insert n copies of the item before the specified position. More... | |
template<class InputIterator > | |
void | rinsert (iterator pos, InputIterator first, InputIterator last) |
Insert the range [first, last) before the specified position. More... | |
iterator | erase (iterator pos) |
Remove an element at the specified position. More... | |
iterator | erase (iterator first, iterator last) |
Erase the range [first, last) . More... | |
iterator | rerase (iterator pos) |
Remove an element at the specified position. More... | |
iterator | rerase (iterator first, iterator last) |
Erase the range [first, last) . More... | |
void | clear () |
Remove all stored elements from the space optimized circular buffer. More... | |
Private Types | |
typedef circular_buffer< T, Alloc > | this_type |
The type of this circular_buffer . More... | |
Private Member Functions | |
typedef | BOOST_RV_REF (value_type) rvalue_type |
A type representing rvalue from param type. More... | |
allocator_type | get_allocator () const BOOST_NOEXCEPT |
Get the allocator. More... | |
allocator_type & | get_allocator () BOOST_NOEXCEPT |
Get the allocator reference. More... | |
iterator | begin () BOOST_NOEXCEPT |
Get the iterator pointing to the beginning of the circular_buffer . More... | |
const_iterator | begin () const BOOST_NOEXCEPT |
Get the const iterator pointing to the beginning of the circular_buffer . More... | |
iterator | end () BOOST_NOEXCEPT |
Get the iterator pointing to the end of the circular_buffer . More... | |
const_iterator | end () const BOOST_NOEXCEPT |
Get the const iterator pointing to the end of the circular_buffer . More... | |
reverse_iterator | rbegin () BOOST_NOEXCEPT |
Get the iterator pointing to the beginning of the "reversed" circular_buffer . More... | |
const_reverse_iterator | rbegin () const BOOST_NOEXCEPT |
Get the const iterator pointing to the beginning of the "reversed" circular_buffer . More... | |
reverse_iterator | rend () BOOST_NOEXCEPT |
Get the iterator pointing to the end of the "reversed" circular_buffer . More... | |
const_reverse_iterator | rend () const BOOST_NOEXCEPT |
Get the const iterator pointing to the end of the "reversed" circular_buffer . More... | |
reference | operator[] (size_type index) |
Get the element at the index position. More... | |
const_reference | operator[] (size_type index) const |
Get the element at the index position. More... | |
reference | at (size_type index) |
Get the element at the index position. More... | |
const_reference | at (size_type index) const |
Get the element at the index position. More... | |
reference | front () |
Get the first element. More... | |
const_reference | front () const |
Get the first element. More... | |
reference | back () |
Get the last element. More... | |
const_reference | back () const |
Get the last element. More... | |
array_range | array_one () |
Get the first continuous array of the internal buffer. More... | |
const_array_range | array_one () const |
Get the first continuous array of the internal buffer. More... | |
array_range | array_two () |
Get the second continuous array of the internal buffer. More... | |
const_array_range | array_two () const |
Get the second continuous array of the internal buffer. More... | |
pointer | linearize () |
Linearize the internal buffer into a continuous array. More... | |
bool | is_linearized () const BOOST_NOEXCEPT |
Is the circular_buffer linearized? More... | |
void | rotate (const_iterator new_begin) |
Rotate elements in the circular_buffer . More... | |
size_type | size () const BOOST_NOEXCEPT |
Get the number of elements currently stored in the circular_buffer . More... | |
size_type | max_size () const BOOST_NOEXCEPT |
Get the largest possible size or capacity of the circular_buffer . More... | |
bool | empty () const BOOST_NOEXCEPT |
Is the circular_buffer empty? More... | |
void | set_capacity (capacity_type new_capacity) |
Change the capacity of the circular_buffer . More... | |
void | rset_capacity (capacity_type new_capacity) |
Change the capacity of the circular_buffer . More... | |
void | swap (circular_buffer< T, Alloc > &cb) BOOST_NOEXCEPT |
Swap the contents of two circular_buffer s. More... | |
void | push_back (rvalue_type item) |
Insert a new element at the end of the circular_buffer using rvalue references or rvalues references emulation. More... | |
void | push_front (rvalue_type item) |
Insert a new element at the beginning of the circular_buffer using rvalue references or rvalues references emulation. More... | |
iterator | insert (iterator pos, rvalue_type item) |
Insert an element at the specified position. More... | |
iterator | rinsert (iterator pos, rvalue_type item) |
Insert an element before the specified position. More... | |
void | erase_begin (size_type n) |
Remove first n elements (with constant complexity for scalar types). More... | |
void | erase_end (size_type n) |
Remove last n elements (with constant complexity for scalar types). More... | |
Space optimized circular buffer container adaptor.
T
must be a copyable class or must have an noexcept move constructor and move assignment operator.
typedef circular_buffer<T, Alloc>::allocator_type boost::circular_buffer_space_optimized< T, Alloc >::allocator_type |
typedef circular_buffer<T, Alloc>::array_range boost::circular_buffer_space_optimized< T, Alloc >::array_range |
typedef cb_details::capacity_control<size_type> boost::circular_buffer_space_optimized< T, Alloc >::capacity_type |
Capacity controller of the space optimized circular buffer.
class capacity_control
{
size_type m_capacity; // Available capacity.
size_type m_min_capacity; // Minimum capacity.
public:
capacity_control(size_type capacity, size_type min_capacity = 0)
: m_capacity(capacity), m_min_capacity(min_capacity)
{};
size_type capacity() const { return m_capacity; }
size_type min_capacity() const { return m_min_capacity; }
operator size_type() const { return m_capacity; }
};
Always capacity >= min_capacity
.
The capacity()
represents the capacity of the circular_buffer_space_optimized
and the min_capacity()
determines the minimal allocated size of its internal buffer.
The converting constructor of the capacity_control
allows implicit conversion from size_type
-like types which ensures compatibility of creating an instance of the circular_buffer_space_optimized
with other STL containers.
On the other hand the operator size_type()
provides implicit conversion to the size_type
which allows to treat the capacity of the circular_buffer_space_optimized
the same way as in the circular_buffer
.
typedef circular_buffer<T, Alloc>::const_array_range boost::circular_buffer_space_optimized< T, Alloc >::const_array_range |
typedef circular_buffer<T, Alloc>::const_iterator boost::circular_buffer_space_optimized< T, Alloc >::const_iterator |
typedef circular_buffer<T, Alloc>::const_pointer boost::circular_buffer_space_optimized< T, Alloc >::const_pointer |
typedef circular_buffer<T, Alloc>::const_reference boost::circular_buffer_space_optimized< T, Alloc >::const_reference |
typedef circular_buffer<T, Alloc>::const_reverse_iterator boost::circular_buffer_space_optimized< T, Alloc >::const_reverse_iterator |
typedef circular_buffer<T, Alloc>::difference_type boost::circular_buffer_space_optimized< T, Alloc >::difference_type |
typedef circular_buffer<T, Alloc>::iterator boost::circular_buffer_space_optimized< T, Alloc >::iterator |
typedef circular_buffer<T, Alloc>::param_value_type boost::circular_buffer_space_optimized< T, Alloc >::param_value_type |
typedef circular_buffer<T, Alloc>::pointer boost::circular_buffer_space_optimized< T, Alloc >::pointer |
typedef circular_buffer<T, Alloc>::reference boost::circular_buffer_space_optimized< T, Alloc >::reference |
typedef circular_buffer<T, Alloc>::reverse_iterator boost::circular_buffer_space_optimized< T, Alloc >::reverse_iterator |
typedef circular_buffer<T, Alloc>::rvalue_type boost::circular_buffer_space_optimized< T, Alloc >::rvalue_type |
typedef circular_buffer<T, Alloc>::size_type boost::circular_buffer_space_optimized< T, Alloc >::size_type |
typedef circular_buffer<T, Alloc>::value_type boost::circular_buffer_space_optimized< T, Alloc >::value_type |
|
inlineexplicit |
Create an empty space optimized circular buffer with zero capacity.
capacity().capacity() == 0 && capacity().min_capacity() == 0 && size() == 0
alloc | The allocator. |
Nothing. |
|
inlineexplicit |
Create an empty space optimized circular buffer with the specified capacity.
capacity() == capacity_ctrl && size() == 0
capacity_ctrl.min_capacity()
. capacity_ctrl | The capacity controller representing the maximum number of elements which can be stored in the circular_buffer_space_optimized and the minimal allocated size of the internal buffer. |
alloc | The allocator. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). |
|
inline |
Create a full space optimized circular buffer with the specified capacity filled with capacity_ctrl.
capacity() copies of item
.
capacity() == capacity_ctrl && full() && (*this)[0] == item && (*this)[1] == item && ... && (*this) [capacity_ctrl.capacity() - 1] == item
capacity_ctrl.capacity()
. capacity_ctrl | The capacity controller representing the maximum number of elements which can be stored in the circular_buffer_space_optimized and the minimal allocated size of the internal buffer. |
item | The element the created circular_buffer_space_optimized will be filled with. |
alloc | The allocator. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). |
Whatever | T::T(const T&) throws. |
capacity_ctrl.capacity()
).
|
inline |
Create a space optimized circular buffer with the specified capacity filled with n
copies of item
.
capacity_ctrl.capacity() >= n
capacity() == capacity_ctrl && size() == n && (*this)[0] == item && (*this)[1] == item && ... && (*this)[n - 1] == item
max[n, capacity_ctrl.min_capacity()]
. capacity_ctrl | The capacity controller representing the maximum number of elements which can be stored in the circular_buffer_space_optimized and the minimal allocated size of the internal buffer. |
n | The number of elements the created circular_buffer_space_optimized will be filled with. |
item | The element the created circular_buffer_space_optimized will be filled with. |
alloc | The allocator. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. |
n
).
|
inline |
The copy constructor.
Creates a copy of the specified circular_buffer_space_optimized
.
*this == cb
cb.size()
. cb | The circular_buffer_space_optimized to be copied. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. |
cb
).
|
inline |
The move constructor.
Move constructs a circular_buffer_space_optimized
from cb
, leaving cb
empty.
cb.empty()
cb | circular_buffer to 'steal' value from. |
Nothing. |
|
inline |
Create a full space optimized circular buffer filled with a copy of the range.
[first, last)
.first
and last
have to meet the requirements of InputIterator. capacity().capacity() == std::distance(first, last) && capacity().min_capacity() == 0 && full() && (*this)[0]== *first && (*this)[1] == *(first + 1) && ... && (*this)[std::distance(first, last) - 1] == *(last - 1)
std::distance(first, last)
. first | The beginning of the range to be copied. |
last | The end of the range to be copied. |
alloc | The allocator. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws or nothing if T::T(T&&) is noexcept and InputIterator is a move iterator. |
std::distance(first, last)
).
|
inline |
Create a space optimized circular buffer with the specified capacity (and the minimal guaranteed amount of allocated memory) filled with a copy of the range.
[first, last)
.first
and last
have to meet the requirements of InputIterator. capacity() == capacity_ctrl && size() <= std::distance(first, last) && (*this)[0]== (last - capacity_ctrl.capacity()) && (*this)[1] == *(last - capacity_ctrl.capacity() + 1) && ... && (*this)[capacity_ctrl.capacity() - 1] == *(last - 1)
[first, last)
is greater than the specified capacity_ctrl.capacity()
then only elements from the range [last - capacity_ctrl.capacity(), last)
will be copied.max[capacity_ctrl.min_capacity(), min[capacity_ctrl.capacity(), std::distance(first, last)]]
. capacity_ctrl | The capacity controller representing the maximum number of elements which can be stored in the circular_buffer_space_optimized and the minimal allocated size of the internal buffer. |
first | The beginning of the range to be copied. |
last | The end of the range to be copied. |
alloc | The allocator. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. |
std::distance(first, last)
; in min[capacity_ctrl.capacity(), std::distance(first, last)]
if the InputIterator
is a RandomAccessIterator). References BOOST_DEDUCED_TYPENAME, and boost::detail::type.
|
inline |
Assign n
items into the space optimized circular buffer.
The content of the circular_buffer_space_optimized
will be removed and replaced with n
copies of the item
.
capacity().capacity() == n && capacity().min_capacity() == 0 && size() == n && (*this)[0] == item && (*this)[1] == item && ... && (*this) [n - 1] == item
n
. n | The number of elements the circular_buffer_space_optimized will be filled with. |
item | The element the circular_buffer_space_optimized will be filled with. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. |
circular_buffer_space_optimized
(except iterators equal to end()
). n
). operator=
, assign(capacity_type, size_type, const_reference)
, assign(InputIterator, InputIterator)
, assign(capacity_type, InputIterator, InputIterator)
References boost::circular_buffer< T, Alloc >::assign().
|
inline |
Assign n
items into the space optimized circular buffer specifying the capacity.
The capacity of the circular_buffer_space_optimized
will be set to the specified value and the content of the circular_buffer_space_optimized
will be removed and replaced with n
copies of the item
.
capacity_ctrl.capacity() >= n
capacity() == capacity_ctrl && size() == n && (*this)[0] == item && (*this)[1] == item && ... && (*this) [n - 1] == item
max[n, capacity_ctrl.min_capacity()]
. capacity_ctrl | The new capacity controller. |
n | The number of elements the circular_buffer_space_optimized will be filled with. |
item | The element the circular_buffer_space_optimized will be filled with. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. |
circular_buffer_space_optimized
(except iterators equal to end()
). n
). operator=
, assign(size_type, const_reference)
, assign(InputIterator, InputIterator)
, assign(capacity_type, InputIterator, InputIterator)
References boost::circular_buffer< T, Alloc >::assign(), BOOST_CB_ASSERT, boost::accumulators::extract::max, and boost::n.
|
inline |
Assign a copy of the range into the space optimized circular buffer.
The content of the circular_buffer_space_optimized
will be removed and replaced with copies of elements from the specified range.
[first, last)
.first
and last
have to meet the requirements of InputIterator. capacity().capacity() == std::distance(first, last) && capacity().min_capacity() == 0 && size() == std::distance(first, last) && (*this)[0]== *first && (*this)[1] == *(first + 1) && ... && (*this)[std::distance(first, last) - 1] == *(last - 1)
std::distance(first, last)
. first | The beginning of the range to be copied. |
last | The end of the range to be copied. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws or nothing if T::T(T&&) is noexcept and InputIterator is a move iterator. |
circular_buffer_space_optimized
(except iterators equal to end()
). std::distance(first, last)
). operator=
, assign(size_type, const_reference)
, assign(capacity_type, size_type, const_reference)
, assign(capacity_type, InputIterator, InputIterator)
References boost::circular_buffer< T, Alloc >::assign().
|
inline |
Assign a copy of the range into the space optimized circular buffer specifying the capacity.
The capacity of the circular_buffer_space_optimized
will be set to the specified value and the content of the circular_buffer_space_optimized
will be removed and replaced with copies of elements from the specified range.
[first, last)
.first
and last
have to meet the requirements of InputIterator. capacity() == capacity_ctrl && size() <= std::distance(first, last) && (*this)[0]== *(last - capacity) && (*this)[1] == *(last - capacity + 1) && ... && (*this)[capacity - 1] == *(last - 1)
[first, last)
is greater than the specified capacity
then only elements from the range [last - capacity, last)
will be copied.max[std::distance(first, last), capacity_ctrl.min_capacity()]
. capacity_ctrl | The new capacity controller. |
first | The beginning of the range to be copied. |
last | The end of the range to be copied. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws or nothing if T::T(T&&) is noexcept and InputIterator is a move iterator. |
circular_buffer_space_optimized
(except iterators equal to end()
). std::distance(first, last)
; in min[capacity_ctrl.capacity(), std::distance(first, last)]
if the InputIterator
is a RandomAccessIterator). operator=
, assign(size_type, const_reference)
, assign(capacity_type, size_type, const_reference)
, assign(InputIterator, InputIterator)
References boost::circular_buffer< T, Alloc >::assign().
|
inline |
Get the capacity of the circular_buffer_space_optimized
.
circular_buffer_space_optimized
and the minimal allocated size of the internal buffer. Nothing. |
circular_buffer_space_optimized
).
|
inline |
Remove all stored elements from the space optimized circular buffer.
size() == 0
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). ~circular_buffer_space_optimized()
, erase(iterator)
, erase(iterator, iterator)
, rerase(iterator)
, rerase(iterator, iterator)
References boost::circular_buffer< T, Alloc >::begin(), boost::circular_buffer< T, Alloc >::end(), and boost::circular_buffer_space_optimized< T, Alloc >::erase().
|
inline |
Remove an element at the specified position.
pos
is a valid iterator pointing to the circular_buffer_space_optimized
(but not an end()
). pos
is removed.pos | An iterator pointing at the element to be removed. |
end()
if no such element exists. An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::operator = (const T&) throws or nothing if T::operator = (T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). References boost::circular_buffer< T, Alloc >::begin(), boost::circular_buffer< T, Alloc >::erase(), and boost::it.
Referenced by boost::circular_buffer_space_optimized< T, Alloc >::clear(), and boost::circular_buffer_space_optimized< T, Alloc >::resize().
|
inline |
Erase the range [first, last)
.
[first, last)
. [first, last)
are removed. (If first == last
nothing is removed.)first | The beginning of the range to be removed. |
last | The end of the range to be removed. |
end()
if no such element exists. An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::operator = (const T&) throws or nothing if T::operator = (T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). References boost::circular_buffer< T, Alloc >::begin(), boost::circular_buffer< T, Alloc >::erase(), and boost::it.
|
inline |
Is the circular_buffer_space_optimized
full?
true
if the number of elements stored in the circular_buffer_space_optimized
equals the capacity of the circular_buffer_space_optimized
; false
otherwise. Nothing. |
circular_buffer_space_optimized
). empty()
References boost::circular_buffer< T, Alloc >::size().
|
inline |
Insert an element at the specified position.
pos
is a valid iterator pointing to the circular_buffer_space_optimized
or its end. item
will be inserted at the position pos
.circular_buffer_space_optimized
is full, the first element will be overwritten. If the circular_buffer_space_optimized
is full and the pos
points to begin()
, then the item
will not be inserted. If the capacity is 0
, nothing will be inserted.pos | An iterator specifying the position where the item will be inserted. |
item | The element to be inserted. |
begin()
if the item
is not inserted. (See the Effect.) An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. Whatever T::operator = (const T&) throws. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). insert(iterator, size_type, value_type)
, insert(iterator, InputIterator, InputIterator)
, rinsert(iterator, value_type)
, rinsert(iterator, size_type, value_type)
, rinsert(iterator, InputIterator, InputIterator)
References boost::circular_buffer< T, Alloc >::begin(), and boost::circular_buffer< T, Alloc >::insert().
Referenced by boost::circular_buffer_space_optimized< T, Alloc >::insert(), and boost::circular_buffer_space_optimized< T, Alloc >::resize().
|
inline |
Insert an element at the specified position.
pos
is a valid iterator pointing to the circular_buffer_space_optimized
or its end. item
will be inserted at the position pos
.circular_buffer_space_optimized
is full, the first element will be overwritten. If the circular_buffer_space_optimized
is full and the pos
points to begin()
, then the item
will not be inserted. If the capacity is 0
, nothing will be inserted.pos | An iterator specifying the position where the item will be inserted. |
item | The element to be inserted. |
begin()
if the item
is not inserted. (See the Effect.) An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws or nothing if T::T(T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). insert(iterator, size_type, value_type)
, insert(iterator, InputIterator, InputIterator)
, rinsert(iterator, value_type)
, rinsert(iterator, size_type, value_type)
, rinsert(iterator, InputIterator, InputIterator)
References boost::circular_buffer< T, Alloc >::begin(), boost::circular_buffer< T, Alloc >::insert(), and boost::move().
|
inline |
Insert an element at the specified position.
pos
is a valid iterator pointing to the circular_buffer_space_optimized
or its end. item
will be inserted at the position pos
.circular_buffer_space_optimized
is full, the first element will be overwritten. If the circular_buffer_space_optimized
is full and the pos
points to begin()
, then the item
will not be inserted. If the capacity is 0
, nothing will be inserted.pos | An iterator specifying the position where the item will be inserted. |
begin()
if the item
is not inserted. (See the Effect.) An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T() throws. Whatever T::T(const T&) throws or nothing if T::T(T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). insert(iterator, size_type, value_type)
, insert(iterator, InputIterator, InputIterator)
, rinsert(iterator, value_type)
, rinsert(iterator, size_type, value_type)
, rinsert(iterator, InputIterator, InputIterator)
References boost::circular_buffer< T, Alloc >::begin(), and boost::circular_buffer< T, Alloc >::insert().
|
inline |
Insert n
copies of the item
at the specified position.
pos
is a valid iterator pointing to the circular_buffer_space_optimized
or its end. min[n, (pos - begin()) + reserve()]
elements will be inserted at the position pos
.min[pos - begin(), max[0, n - reserve()]]
elements will be overwritten at the beginning of the circular_buffer_space_optimized
.pos | An iterator specifying the position where the item s will be inserted. |
n | The number of item s the to be inserted. |
item | The element whose copies will be inserted. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. Whatever T::operator = (const T&) throws. |
circular_buffer_space_optimized
(except iterators equal to end()
). min[capacity().capacity(), size() + n]
). circular_buffer_space_optimized
with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.|1|2|3|4| | |
p ___^
p
:insert(p, (size_t)5, 0);
1
and 2
are overwritten. This is due to the fact the insert operation preserves the capacity. After insertion the internal buffer looks like this:|0|0|0|0|3|4|
|1|2|0|0|0|0|0|3|4|
. insert(iterator, value_type)
, insert(iterator, InputIterator, InputIterator)
, rinsert(iterator, value_type)
, rinsert(iterator, size_type, value_type)
, rinsert(iterator, InputIterator, InputIterator)
References boost::circular_buffer< T, Alloc >::begin(), and boost::circular_buffer< T, Alloc >::insert().
|
inline |
Insert the range [first, last)
at the specified position.
pos
is a valid iterator pointing to the circular_buffer_space_optimized
or its end.[first, last)
where first
and last
meet the requirements of an InputIterator. [first + max[0, distance(first, last) - (pos - begin()) - reserve()], last)
will be inserted at the position pos
.min[pos - begin(), max[0, distance(first, last) - reserve()]]
elements will be overwritten at the beginning of the circular_buffer_space_optimized
.pos | An iterator specifying the position where the range will be inserted. |
first | The beginning of the range to be inserted. |
last | The end of the range to be inserted. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws or nothing if T::T(T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). [size() + std::distance(first, last)]
; in min[capacity().capacity(), size() + std::distance(first, last)]
if the InputIterator
is a RandomAccessIterator). circular_buffer_space_optimized
with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.|1|2|3|4| | |
p ___^
p
:int array[] = { 5, 6, 7, 8, 9 };
insert(p, array, array + 5);
6
, 7
, 8
and 9
from the specified range get inserted and elements 1
and 2
are overwritten. This is due to the fact the insert operation preserves the capacity. After insertion the internal buffer looks like this:|6|7|8|9|3|4|
|1|2|5|6|7|8|9|3|4|
. insert(iterator, value_type)
, insert(iterator, size_type, value_type)
, rinsert(iterator, value_type)
, rinsert(iterator, size_type, value_type)
, rinsert(iterator, InputIterator, InputIterator)
References boost::circular_buffer_space_optimized< T, Alloc >::insert().
|
inline |
The assign operator.
Makes this circular_buffer_space_optimized
to become a copy of the specified circular_buffer_space_optimized
.
*this == cb
cb.size()
. cb | The circular_buffer_space_optimized to be copied. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). |
Whatever | T::T(const T&) throws. |
circular_buffer_space_optimized
(except iterators equal to end()
). cb
). assign(size_type, const_reference)
, assign(capacity_type, size_type, const_reference)
, assign(InputIterator, InputIterator)
, assign(capacity_type, InputIterator, InputIterator)
References boost::circular_buffer< T, Alloc >::assign(), boost::circular_buffer< T, Alloc >::begin(), and boost::circular_buffer< T, Alloc >::end().
|
inline |
Move assigns content of cb
to *this
, leaving cb
empty.
cb.empty()
cb | circular_buffer to 'steal' value from. |
Nothing. |
References boost::circular_buffer< T, Alloc >::get_allocator(), and boost::circular_buffer_space_optimized< T, Alloc >::swap().
|
inline |
Remove the last element from the space optimized circular buffer.
!empty()
circular_buffer_space_optimized
.An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). References boost::circular_buffer< T, Alloc >::pop_back().
|
inline |
Remove the first element from the space optimized circular buffer.
!empty()
circular_buffer_space_optimized
.An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). References boost::circular_buffer< T, Alloc >::pop_front().
|
inline |
Insert a new element at the end of the space optimized circular buffer.
capacity().capacity() > 0
then back() == item
circular_buffer_space_optimized
is full, the first element will be removed. If the capacity is 0
, nothing will be inserted.item | The element to be inserted. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). push_front(const_reference)
, pop_back()
, pop_front()
References boost::circular_buffer< T, Alloc >::push_back().
|
inline |
Insert a new element at the end of the space optimized circular buffer.
capacity().capacity() > 0
then back() == item
circular_buffer_space_optimized
is full, the first element will be removed. If the capacity is 0
, nothing will be inserted.item | The element to be inserted. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). push_front(const_reference)
, pop_back()
, pop_front()
References boost::move(), and boost::circular_buffer< T, Alloc >::push_back().
|
inline |
Insert a new element at the end of the space optimized circular buffer.
capacity().capacity() > 0
then back() == item
circular_buffer_space_optimized
is full, the first element will be removed. If the capacity is 0
, nothing will be inserted.An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T() throws. Whatever T::T(const T&) throws or nothing if T::T(T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). push_front(const_reference)
, pop_back()
, pop_front()
References boost::circular_buffer< T, Alloc >::push_back().
|
inline |
Insert a new element at the beginning of the space optimized circular buffer.
capacity().capacity() > 0
then front() == item
circular_buffer_space_optimized
is full, the last element will be removed. If the capacity is 0
, nothing will be inserted.item | The element to be inserted. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). push_back(const_reference)
, pop_back()
, pop_front()
References boost::circular_buffer< T, Alloc >::push_front().
|
inline |
Insert a new element at the beginning of the space optimized circular buffer.
capacity().capacity() > 0
then front() == item
circular_buffer_space_optimized
is full, the last element will be removed. If the capacity is 0
, nothing will be inserted.item | The element to be inserted. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws or nothing if T::T(T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). push_back(const_reference)
, pop_back()
, pop_front()
References boost::move(), and boost::circular_buffer< T, Alloc >::push_front().
|
inline |
Insert a new element at the beginning of the space optimized circular buffer.
capacity().capacity() > 0
then front() == item
circular_buffer_space_optimized
is full, the last element will be removed. If the capacity is 0
, nothing will be inserted.An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T() throws. Whatever T::T(const T&) throws or nothing if T::T(T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). push_back(const_reference)
, pop_back()
, pop_front()
References boost::circular_buffer< T, Alloc >::push_front().
|
inline |
Remove an element at the specified position.
pos
is a valid iterator pointing to the circular_buffer_space_optimized
(but not an end()
).pos
is removed. pos | An iterator pointing at the element to be removed. |
begin()
if no such element exists. An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::operator = (const T&) throws or nothing if T::operator = (T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). erase(iterator)
and this method. It is implemented only for consistency with the base circular_buffer
. References boost::circular_buffer< T, Alloc >::begin(), boost::it, and boost::circular_buffer< T, Alloc >::rerase().
Referenced by boost::circular_buffer_space_optimized< T, Alloc >::rresize().
|
inline |
Erase the range [first, last)
.
[first, last)
. [first, last)
are removed. (If first == last
nothing is removed.)first | The beginning of the range to be removed. |
last | The end of the range to be removed. |
begin()
if no such element exists. An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::operator = (const T&) throws or nothing if T::operator = (T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). erase(iterator, iterator)
and this method. It is implemented only for consistency with the base <circular_buffer
. References boost::circular_buffer< T, Alloc >::begin(), boost::it, and boost::circular_buffer< T, Alloc >::rerase().
|
inline |
Get the maximum number of elements which can be inserted into the circular_buffer_space_optimized
without overwriting any of already stored elements.
capacity().capacity() - size()
Nothing. |
circular_buffer_space_optimized
). capacity()
, size()
, max_size()
References boost::circular_buffer< T, Alloc >::size().
|
inline |
Change the size of the circular_buffer_space_optimized
.
size() == new_size && capacity().capacity() >= new_size
item
will be inserted at the back of the of the circular_buffer_space_optimized
in order to achieve the desired size. In the case the resulting size exceeds the current capacity the capacity will be set to new_size
.circular_buffer_space_optimized
is greater than the desired new size then number of [size() - new_size]
last elements will be removed. (The capacity will remain unchanged.)new_size | The new size. |
item | The element the circular_buffer_space_optimized will be filled with in order to gain the requested size. (See the Effect.) |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). References boost::circular_buffer< T, Alloc >::end(), boost::circular_buffer_space_optimized< T, Alloc >::erase(), boost::circular_buffer_space_optimized< T, Alloc >::insert(), and boost::circular_buffer< T, Alloc >::size().
|
inline |
Insert an element before the specified position.
pos
is a valid iterator pointing to the circular_buffer_space_optimized
or its end. item
will be inserted before the position pos
.circular_buffer_space_optimized
is full, the last element will be overwritten. If the circular_buffer_space_optimized
is full and the pos
points to end()
, then the item
will not be inserted. If the capacity is 0
, nothing will be inserted.pos | An iterator specifying the position before which the item will be inserted. |
item | The element to be inserted. |
end()
if the item
is not inserted. (See the Effect.) An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. Whatever T::operator = (const T&) throws. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). rinsert(iterator, size_type, value_type)
, rinsert(iterator, InputIterator, InputIterator)
, insert(iterator, value_type)
, insert(iterator, size_type, value_type)
, insert(iterator, InputIterator, InputIterator)
References boost::circular_buffer< T, Alloc >::begin(), and boost::circular_buffer< T, Alloc >::rinsert().
Referenced by boost::circular_buffer_space_optimized< T, Alloc >::rinsert(), and boost::circular_buffer_space_optimized< T, Alloc >::rresize().
|
inline |
Insert an element before the specified position.
pos
is a valid iterator pointing to the circular_buffer_space_optimized
or its end. item
will be inserted before the position pos
.circular_buffer_space_optimized
is full, the last element will be overwritten. If the circular_buffer_space_optimized
is full and the pos
points to end()
, then the item
will not be inserted. If the capacity is 0
, nothing will be inserted.pos | An iterator specifying the position before which the item will be inserted. |
item | The element to be inserted. |
end()
if the item
is not inserted. (See the Effect.) An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws or nothing if T::T(T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). rinsert(iterator, size_type, value_type)
, rinsert(iterator, InputIterator, InputIterator)
, insert(iterator, value_type)
, insert(iterator, size_type, value_type)
, insert(iterator, InputIterator, InputIterator)
References boost::circular_buffer< T, Alloc >::begin(), boost::move(), and boost::circular_buffer< T, Alloc >::rinsert().
|
inline |
Insert an element before the specified position.
pos
is a valid iterator pointing to the circular_buffer_space_optimized
or its end. item
will be inserted before the position pos
.circular_buffer_space_optimized
is full, the last element will be overwritten. If the circular_buffer_space_optimized
is full and the pos
points to end()
, then the item
will not be inserted. If the capacity is 0
, nothing will be inserted.pos | An iterator specifying the position before which the item will be inserted. |
end()
if the item
is not inserted. (See the Effect.) An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T() throws. Whatever T::T(const T&) throws or nothing if T::T(T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). rinsert(iterator, size_type, value_type)
, rinsert(iterator, InputIterator, InputIterator)
, insert(iterator, value_type)
, insert(iterator, size_type, value_type)
, insert(iterator, InputIterator, InputIterator)
References boost::circular_buffer< T, Alloc >::begin(), and boost::circular_buffer< T, Alloc >::rinsert().
|
inline |
Insert n
copies of the item
before the specified position.
pos
is a valid iterator pointing to the circular_buffer_space_optimized
or its end. min[n, (end() - pos) + reserve()]
elements will be inserted before the position pos
.min[end() - pos, max[0, n - reserve()]]
elements will be overwritten at the end of the circular_buffer_space_optimized
.pos | An iterator specifying the position where the item s will be inserted. |
n | The number of item s the to be inserted. |
item | The element whose copies will be inserted. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. Whatever T::operator = (const T&) throws. |
circular_buffer_space_optimized
(except iterators equal to end()
). min[capacity().capacity(), size() + n]
). circular_buffer_space_optimized
with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.|1|2|3|4| | |
p ___^
p
:rinsert(p, (size_t)5, 0);
3
and 4
are overwritten. This is due to the fact the rinsert operation preserves the capacity. After insertion the internal buffer looks like this:|1|2|0|0|0|0|
|1|2|0|0|0|0|0|3|4|
. rinsert(iterator, value_type)
, rinsert(iterator, InputIterator, InputIterator)
, insert(iterator, value_type)
, insert(iterator, size_type, value_type)
, insert(iterator, InputIterator, InputIterator)
References boost::circular_buffer< T, Alloc >::begin(), and boost::circular_buffer< T, Alloc >::rinsert().
|
inline |
Insert the range [first, last)
before the specified position.
pos
is a valid iterator pointing to the circular_buffer_space_optimized
or its end.[first, last)
where first
and last
meet the requirements of an InputIterator. [first, last - max[0, distance(first, last) - (end() - pos) - reserve()])
will be inserted before the position pos
.min[end() - pos, max[0, distance(first, last) - reserve()]]
elements will be overwritten at the end of the circular_buffer
.pos | An iterator specifying the position where the range will be inserted. |
first | The beginning of the range to be inserted. |
last | The end of the range to be inserted. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. Whatever T::operator = (const T&) throws. |
circular_buffer_space_optimized
(except iterators equal to end()
). [size() + std::distance(first, last)]
; in min[capacity().capacity(), size() + std::distance(first, last)]
if the InputIterator
is a RandomAccessIterator). circular_buffer_space_optimized
with the capacity of 6 and the size of 4. Its internal buffer may look like the one below.|1|2|3|4| | |
p ___^
p
:int array[] = { 5, 6, 7, 8, 9 };
insert(p, array, array + 5);
5
, 6
, 7
and 8
from the specified range get inserted and elements 3
and 4
are overwritten. This is due to the fact the rinsert operation preserves the capacity. After insertion the internal buffer looks like this:|1|2|5|6|7|8|
|1|2|5|6|7|8|9|3|4|
. rinsert(iterator, value_type)
, rinsert(iterator, size_type, value_type)
, insert(iterator, value_type)
, insert(iterator, size_type, value_type)
, insert(iterator, InputIterator, InputIterator)
References boost::circular_buffer_space_optimized< T, Alloc >::rinsert().
|
inline |
Change the size of the circular_buffer_space_optimized
.
size() == new_size && capacity().capacity() >= new_size
item
will be inserted at the front of the of the circular_buffer_space_optimized
in order to achieve the desired size. In the case the resulting size exceeds the current capacity the capacity will be set to new_size
.circular_buffer_space_optimized
is greater than the desired new size then number of [size() - new_size]
first elements will be removed. (The capacity will remain unchanged.)new_size | The new size. |
item | The element the circular_buffer_space_optimized will be filled with in order to gain the requested size. (See the Effect.) |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws. |
circular_buffer_space_optimized
(except iterators equal to end()
). circular_buffer_space_optimized
). References boost::circular_buffer< T, Alloc >::begin(), boost::circular_buffer< T, Alloc >::end(), boost::circular_buffer_space_optimized< T, Alloc >::rerase(), boost::circular_buffer_space_optimized< T, Alloc >::rinsert(), and boost::circular_buffer< T, Alloc >::size().
|
inline |
Change the capacity (and the minimal guaranteed amount of allocated memory) of the circular_buffer_space_optimized
.
capacity() == capacity_ctrl && size() <= capacity_ctrl
circular_buffer_space_optimized
is greater than the desired new capacity then number of [size() - capacity_ctrl.capacity()]
first elements will be removed and the new size will be equal to capacity_ctrl.capacity()
.circular_buffer_space_optimized
is lower than the new capacity then the amount of allocated memory in the internal buffer may be accommodated as necessary but it will never drop below capacity_ctrl.min_capacity()
. capacity_ctrl | The new capacity controller. |
An allocation error | if memory is exhausted (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws or nothing if T::T(T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). min[size(), capacity_ctrl.capacity()]
). References boost::asio::b, boost::circular_buffer< T, Alloc >::begin(), boost::circular_buffer< T, Alloc >::rerase(), and boost::circular_buffer< T, Alloc >::size().
|
inline |
Change the capacity (and the minimal guaranteed amount of allocated memory) of the circular_buffer_space_optimized
.
capacity() == capacity_ctrl && size() <= capacity_ctrl.capacity()
circular_buffer_space_optimized
is greater than the desired new capacity then number of [size() - capacity_ctrl.capacity()]
last elements will be removed and the new size will be equal to capacity_ctrl.capacity()
.circular_buffer_space_optimized
is lower than the new capacity then the amount of allocated memory in the internal buffer may be accommodated as necessary but it will never drop below capacity_ctrl.min_capacity()
. capacity_ctrl | The new capacity controller. |
An allocation error | if memory is exhausted, (std::bad_alloc if the standard allocator is used). Whatever T::T(const T&) throws or nothing if T::T(T&&) is noexcept. |
circular_buffer_space_optimized
(except iterators equal to end()
). min[size(), capacity_ctrl.capacity()]
). boost::circular_buffer_space_optimized<int> cb(1000);
...
boost::circular_buffer_space_optimized<int>(cb).swap(cb);
References boost::circular_buffer< T, Alloc >::end(), boost::circular_buffer< T, Alloc >::erase(), and boost::circular_buffer< T, Alloc >::size().
|
inline |
Swap the contents of two space-optimized circular-buffers.
this
contains elements of cb
and vice versa; the capacity and the amount of allocated memory in the internal buffer of this
equal to the capacity and the amount of allocated memory of cb
and vice versa. cb | The circular_buffer_space_optimized whose content will be swapped. |
Nothing. |
circular_buffer_space_optimized
containers. (On the other hand the iterators still point to the same elements but within another container. If you want to rely on this feature you have to turn the __debug_support off by defining macro BOOST_CB_DISABLE_DEBUG, otherwise an assertion will report an error if such invalidated iterator is used.) circular_buffer_space_optimized
). swap(circular_buffer<T, Alloc>&, circular_buffer<T, Alloc>&)
, swap(circular_buffer_space_optimized<T, Alloc>&, circular_buffer_space_optimized<T, Alloc>&)
References boost::circular_buffer< T, Alloc >::swap(), and boost::swap().
Referenced by boost::circular_buffer_space_optimized< T, Alloc >::operator=().