Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit 064f557086.
PrevUpHomeNext
param::param (4 of 4 overloads)

Constructor.

Synopsis
template<
    class OptionalString>
param(
    core::string_view key,
    OptionalString const& 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.

Template Parameters

Type

Description

OptionalString

An optional string type, such as core::string_view, std::nullptr, no_value_t, or optional<core::string_view>.

Parameters

Name

Description

key, value

The key and value to set.


PrevUpHomeNext