:relfileprefix: ../../../
[#boost-urls-url-swap]

== xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/url.adoc[pass:[url]]::swap


Swap the contents.


=== Synopsis

Declared in header `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L360[boost/url/url.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
void
swap(xref:boost/urls/url.adoc[url]& other) noexcept;
----

=== Description


Exchanges the contents of this url with another
url. All views, iterators and references remain valid.

If `this &equals;&equals; &amp;other`, this function call has no effect.
[,cpp]
----
url u1( "https://www.example.com" );
url u2( "https://www.boost.org" );
u1.swap(u2);
assert(u1 == "https://www.boost.org" );
assert(u2 == "https://www.example.com" );
----

=== Constant

=== Throws nothing.





=== Parameters

|===
| Name | Description 

| *other*
| 
The object to swap with

|===




