:relfileprefix: ../../../
[#5D7D0C68CA1E8160765F482D3C464B1DD8747446]

= Function param_pct_view::param_pct_view

pass:v,q[Constructor]


== Synopsis

Declared in header `</boost/url/param.hpp#L776[boost/url/param.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
template<class OptionalString>
param_pct_view(
    xref:boost/urls/pct_string_view.adoc[pct_string_view] key,
    const OptionalString& value);
----

== Description

pass:v,q[This constructs a parameter with a key] pass:v,q[and optional value, which may both]
pass:v,q[contain percent escapes.]
pass:v,q[The new key and value reference]
pass:v,q[the same corresponding underlying]
pass:v,q[character buffers.]
pass:v,q[Ownership of the buffers is not transferred;]
pass:v,q[the caller is responsible for ensuring that]
pass:v,q[the assigned buffers remain valid until]
pass:v,q[they are no longer referenced.]

=== Example
[,cpp]
----
param_pct_view qp( "key", optional<core::string_view>("value") );
----

=== Postconditions
[,cpp]
----
this->key.data() == key.data() && this->value->data() == value->data() && this->has_value == true
----

=== Complexity
pass:v,q[Linear in `key.size() + value->size()`.]

=== Exception Safety
pass:v,q[Exceptions thrown on invalid input.]



== Return Value

* `void` 


== Parameters

|===
| Name | Type 

| *key*
| `pct_string_view`

| *value*
| ``

|===



