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

Constructor

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
explicit
decode&lowbar;view(
    xref:boost/urls/pct_string_view.adoc[pct&lowbar;string&lowbar;view] s,
    xref:boost/urls/encoding_opts.adoc[encoding&lowbar;opts] opt = &lcub;&rcub;) noexcept;
----

== Description

This constructs a view from the character buffer `s`, which must remain valid and unmodified until the view is no longer accessed&period;

== Example

[,cpp]
----
decode_view ds( "Program%20Files" );
----
== Postconditions

[,cpp]
----
this->encoded() == s
----
== Complexity

Linear in `s&period;size()`&period;

== Exception Safety

Although this function does not throw exceptions, implicitly constructing a xref:boost/urls/pct_string_view.adoc[`pct&lowbar;string&lowbar;view`] for the first argument can throw exceptions on invalid input&period;

== Parameters

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

| *s*
| A percent&hyphen;encoded string that has already been validated&period; Implicit conversion from other string types is supported but may throw exceptions&period;
| *opt*
| The options for decoding&period; If this parameter is omitted, the default options are used&period;
|===


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