[#boost-urls-url-2constructor] = xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url.adoc[url]::url :relfileprefix: ../../../ :mrdocs: Constructor == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url.hpp#L120[boost/url/url.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:boost/urls/url/2constructor-0f0.adoc[url]() noexcept; ---- [.small]#xref:boost/urls/url/2constructor-0f0.adoc[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:boost/urls/url/2constructor-002.adoc[url](core::string_view s); ---- [.small]#xref:boost/urls/url/2constructor-002.adoc[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:boost/urls/url/2constructor-01.adoc[url](xref:boost/urls/url.adoc[url]&& u) noexcept; ---- [.small]#xref:boost/urls/url/2constructor-01.adoc[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:boost/urls/url/2constructor-001.adoc[url](xref:boost/urls/url_view_base.adoc[url_view_base] const& u); ---- [.small]#xref:boost/urls/url/2constructor-001.adoc[_» more..._]# [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:boost/urls/url/2constructor-0f7.adoc[url](xref:boost/urls/url.adoc[url] const& u); ---- [.small]#xref:boost/urls/url/2constructor-0f7.adoc[_» more..._]# == Description Default constructed urls contain a zero‐length string. This matches the grammar for a relative‐ref with an empty path and no query or fragment. === Example [,cpp] ---- url u; ---- === Postconditions [,cpp] ---- this->empty() == true ---- === Complexity Constant. === Exception Safety Throws nothing. === BNF [,cpp] ---- relative-ref = relative-part [ "?" query ] [ "#" fragment ] ---- === Specification link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4.2. Relative Reference (rfc3986)] == Exceptions |=== | Name | Thrown on | `system_error` | The input does not contain a valid url. | `std::length_error` | `u.size() > max_size()`. |=== == Parameters |=== | Name | Description | *s* | The string to parse. | *u* | The url to move from. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#