[#boost-urls-pct_string_view-2constructor-0c]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/pct_string_view.adoc[pct&lowbar;string&lowbar;view]::pct&lowbar;string&lowbar;view
:relfileprefix: ../../../
:mrdocs:

Constructor

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;std::convertible&lowbar;to&lt;core::string&lowbar;view&gt; String&gt;
requires std&colon;&colon;is&lowbar;convertible&lt;
                String,
                core&colon;&colon;string&lowbar;view
                    &gt;&colon;&colon;value
constexpr
pct&lowbar;string&lowbar;view(String const& s);
----

== Description

The newly constructed string references the specified character buffer&period; Ownership is not transferred&period;

== Postconditions

[,cpp]
----
this->data() == core::string_view(s).data()
----
== Complexity

Linear in `core&colon;&colon;string&lowbar;view(s)&period;size()`&period;

== Exception Safety

Exceptions thrown on invalid input&period;

== Exceptions

[cols="1,4"]
|===
| Name
| Thrown on
| `system&lowbar;error`
| The string contains an invalid percent encoding&period;
|===

== Template Parameters

[cols="1,4"]
|===
|Name|Description

| *String*
| A type convertible to `core&colon;&colon;string&lowbar;view`
|===

== Parameters

[cols="1,4"]
|===
|Name|Description

| *s*
| The string to construct from&period;
|===


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