Constructor

Synopsis

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

template<class OptionalString>
param(
    string_view key,
    const OptionalString& value);

Description

This constructs a parameter with a key and value. No validation is performed on the strings. Ownership of the key and value is acquired by making copies.

Example

param qp( "key", "value" );
param qp( "key", optional<core::string_view>("value") );
param qp( "key", boost::none );
param qp( "key", nullptr );
param qp( "key", no_value );

Postconditions

this->key == key && this->value == value && this->has_value == true

Complexity

Linear in key.size() + value.size().

Exception Safety

Calls to allocate may throw.

Return Value

  • void

Parameters

Name Type

key

string_view

value

``