key_value_pair::key_value_pair

Copy constructor.

Synopsis

key_value_pair(
    key_value_pair const& other); (1)

key_value_pair(
    key_value_pair const& other,
    storage_ptr sp); (2)

key_value_pair(
    key_value_pair&& other) noexcept; (3)

key_value_pair(
    pilfered< key_value_pair > other) noexcept; (4)

template<
    class... Args>
explicit
key_value_pair(
    string_view key,
    Args&&... args); (5)

explicit
key_value_pair(
    std::pair< string_view, value > const& p,
    storage_ptr sp = {}); (6)

explicit
key_value_pair(
    std::pair< string_view, value >&& p,
    storage_ptr sp = {}); (7)

Description

This constructs a key/value pair with a copy of another key/value pair, using the same memory resource as other.

Exception Safety

Strong guarantee. Calls to memory_resource::allocate may throw.

Parameters

Name Description

other

The key/value pair to copy.

sp

A pointer to the boost::container::pmr::memory_resource to use. The element will acquire shared ownership of the memory resource.

key

The key string to use.

args

Optional arguments forwarded to the value constructor.

p

A std::pair with the key string and value to construct with.