Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Function template swap

boost::swap — Swap the contents of two circular_buffers.

Synopsis

// In header: <boost/circular_buffer/base.hpp>


template<typename T, typename Alloc> 
  void swap(circular_buffer< T, Alloc > & lhs, 
            circular_buffer< T, Alloc > & rhs);

Description

Complexity. Constant (in the size of the circular_buffers).

Iterator Invalidation. Invalidates all iterators of both circular_buffers. (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 otherwise an assertion will report an error if such invalidated iterator is used.)

See Also:

swap(circular_buffer<T, Alloc>&)

Parameters:

lhs

The circular_buffer whose content will be swapped with rhs.

rhs

The circular_buffer whose content will be swapped with lhs.

Postconditions:

lhs contains elements of rhs and vice versa.

Throws:

Nothing.

PrevUpHomeNext