| Home | Libraries | People | FAQ | More

## Function template swap

boost::swap — Swap the contents of two `circular_buffer`s.

## 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_buffer``s).

Iterator Invalidation. Invalidates all iterators of both ``circular_buffer``s. (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.