[#boost-urls-url-operator_assign-0b]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url.adoc[url]::operator&equals;
:relfileprefix: ../../../
:mrdocs:

Assignment

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L299[boost&sol;url&sol;url&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:boost/urls/url.adoc[url]&
operator&equals;(xref:boost/urls/url_view_base.adoc[url&lowbar;view&lowbar;base] const& u);
----

== Description

The contents of `u` are copied and the previous contents of `this` are destroyed&period; Capacity is preserved, or increases&period;

== Postconditions

[,cpp]
----
this->buffer() == u.buffer() && this->buffer().data() != u.buffer().data()
----
== Complexity

Linear in `u&period;size()`&period;

== Exception Safety

Strong guarantee&period; Calls to allocate may throw&period;

== Exceptions

[cols="1,4"]
|===
| Name| Thrown on
| `std&colon;&colon;length&lowbar;error`
| `u&period;size() &gt; max&lowbar;size()`&period;
|===

== Return Value

A reference to this object&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *u*
| The url to copy&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
