:relfileprefix: ../../../
[#boost-urls-url-2constructor-0f7]

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


Constructor


== Synopsis

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

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

== Description


The newly constructed object
contains a copy of `u`.

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

=== Complexity

Linear in `u.size()`.

=== Exception Safety

Strong guarantee.
Calls to allocate may throw.



== Exceptions

|===
| Name | Thrown on

| `std::length_error`
| 
`u.size() &gt; max_size()`.

|===



== Parameters

|===
| Name | Description 

| *u*
| 
The url to copy.

|===




