[#boost-urls-url_view-2constructor]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/url_view.adoc[url&lowbar;view]::url&lowbar;view
:relfileprefix: ../../../
:mrdocs:


Constructor

== Synopsis


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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:boost/urls/url_view/2constructor-00.adoc[url&lowbar;view](&sol;&ast; implementation-defined &ast;&sol;::url&lowbar;impl const& impl) noexcept;
----

[.small]#xref:boost/urls/url_view/2constructor-00.adoc[_» more..._]#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:boost/urls/url_view/2constructor-0c.adoc[url&lowbar;view]() noexcept;
----

[.small]#xref:boost/urls/url_view/2constructor-0c.adoc[_» more..._]#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:boost/urls/url_view/2constructor-025.adoc[url&lowbar;view](core::string&lowbar;view s);
----

[.small]#xref:boost/urls/url_view/2constructor-025.adoc[_» more..._]#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class String&gt;
requires std&colon;&colon;is&lowbar;convertible&lt;
                String,
                core&colon;&colon;string&lowbar;view
                    &gt;&colon;&colon;value &amp;&amp;
            !std&colon;&colon;is&lowbar;convertible&lt;
                String&ast;,
                url&lowbar;view&lowbar;base&ast;
                    &gt;&colon;&colon;value &amp;&amp; std&colon;&colon;is&lowbar;convertible&lt;
                String,
                core&colon;&colon;string&lowbar;view
                    &gt;&colon;&colon;value &amp;&amp;
            !std&colon;&colon;is&lowbar;convertible&lt;
                String&ast;,
                url&lowbar;view&lowbar;base&ast;
                    &gt;&colon;&colon;value
xref:boost/urls/url_view/2constructor-00.adoc[url&lowbar;view](String const& s);
----

[.small]#xref:boost/urls/url_view/2constructor-00.adoc[_» more..._]#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:boost/urls/url_view/2constructor-024.adoc[url&lowbar;view](xref:boost/urls/url_view.adoc[url&lowbar;view] const& other) noexcept;
----

[.small]#xref:boost/urls/url_view/2constructor-024.adoc[_» more..._]#

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:boost/urls/url_view/2constructor-0a.adoc[url&lowbar;view](xref:boost/urls/url_view_base.adoc[url&lowbar;view&lowbar;base] const& other) noexcept;
----

[.small]#xref:boost/urls/url_view/2constructor-0a.adoc[_» more..._]#

== Description


Default constructed views refer to        a string with zero length, which        always remains valid&period; This matches        the grammar for a relative&hyphen;ref with        an empty path and no query or        fragment&period;


=== Example

[,cpp]
----
url_view u;
----

=== Postconditions

[,cpp]
----
this->empty() == true
----

=== Complexity

Constant&period;


=== Exception Safety

Throws nothing&period;


=== BNF

[,cpp]
----
relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
----

=== Specification

link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.2[4&period;2&period; Relative Reference (rfc3986)]



== Exceptions


|===
| Name | Thrown on

| `system&lowbar;error`
| The input failed to parse correctly&period;


|===

== Parameters


|===
| Name | Description

| *s*
| The string to parse&period;


|===



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