Swap

Synopsis

Declared in header </boost/url/url.hpp#L396[boost/url/url.hpp,window=blank_]>

void
swap(
    url& v0,
    url& v1) noexcept;

Description

Exchanges the contents of v0 with another v1. All views, iterators and references remain valid. If ` &v 0 == &v 1`, this function call has no effect.

Example

url u1( "https://www.example.com" );
url u2( "https://www.boost.org" );
std::swap(u1, u2);
assert(u1 == "https://www.boost.org" );
assert(u2 == "https://www.example.com" );

Effects

v0.swap( v1 );

Complexity

Constant

Exception Safety

Throws nothing

Return Value

  • void

Parameters

Name Type

v0

``

v1

``