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 to view this page for the latest version.
PrevUpHomeNext
array::swap (1 of 2 overloads)

Exchange the given values.

Synopsis

Defined in header <boost/json/array.hpp>

friend void
swap(
    array& lhs,
    array& rhs);
Description

Exchanges the contents of the array lhs with another array rhs. Ownership of the respective memory_resource objects is not transferred.

Effects
lhs.swap( rhs );
Complexity

Constant or linear in lhs.size() + rhs.size().

Exception Safety

Strong guarantee. Calls to memory_resource::allocate may throw.

Parameters

Name

Description

lhs

The array to exchange.

rhs

The array to exchange. If &lhs == &rhs, this function call has no effect.

See Also

array::swap

Convenience header <boost/json.hpp>


PrevUpHomeNext