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
value::swap (2 of 2 overloads)

Swap the given values.

Synopsis

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

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

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

Effects
lhs.swap( rhs );
Complexity

Constant or linear in the sum of the sizes of the values.

Exception Safety

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

Parameters

Name

Description

lhs

The value to exchange.

rhs

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

See Also

value::swap

Convenience header <boost/json.hpp>


PrevUpHomeNext