[#boost-urls-url-2constructor-0f7]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url.adoc[url]::url
:relfileprefix: ../../../
:mrdocs:


Constructor

== Synopsis


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

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

== Description


The newly constructed object        contains a copy of `u`&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


|===
| Name | Thrown on

| `std&colon;&colon;length&lowbar;error`
| `u&period;size() &gt; max&lowbar;size()`&period;


|===

== Parameters


|===
| Name | Description

| *u*
| The url to copy&period;


|===



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