bsl::pair::pair

Constructors

Synopses

Declared in <bslstl_pair.h>

Construct a pair with the first and second members initialized to default values.

constexpr
pair() = default;
» more...

Construct a pair from the specified other pair.

template<
    class PARAM_1,
    class PARAM_2,
    class = void>
requires std::is_constructible<T1, const PARAM_1&>::value &&
                            std::is_constructible<T2, const PARAM_2&>::value
constexpr
pair(pair<PARAM_1, PARAM_2> const& other);
» more...

Construct a pair from the specified other rvalue pair.

template<
    class PARAM_1,
    class PARAM_2,
    class = void>
requires bsl::is_convertible<PARAM_1, T1>::value
                                    && bsl::is_convertible<PARAM_2, T2>::value
constexpr
pair(pair<PARAM_1, PARAM_2>&& other);
» more...

Construct a default pair, using the specified basicAllocator to supply memory for each member when its type uses bslma-style allocators.

explicit
pair(BloombergLP::bslma::Allocator* basicAllocator);
» more...

Create a pair having the same value as the specified rhs pair proxy.

template<
    class PARAM_1,
    class PARAM_2>
constexpr
pair(BloombergLP::bslma::ManagedPtr_PairProxy<PARAM_1, PARAM_2> const& rhs);
» more...

Same as the preceding overload.

template<
    class PARAM_1,
    class PARAM_2,
    class = void>
requires std::is_constructible<T1, const PARAM_1&>::value &&
                            std::is_constructible<T2, const PARAM_2&>::value
constexpr
pair(std::pair<PARAM_1, PARAM_2> const& other);
» more...

Same as the constructor taking pair<PARAM_1, PARAM_2>&&.

template<
    class PARAM_1,
    class PARAM_2,
    class = void>
requires bsl::is_convertible<PARAM_1, T1>::value
                                    && bsl::is_convertible<PARAM_2, T2>::value
constexpr
pair(std::pair<PARAM_1, PARAM_2>&& other);
» more...

Construct a pair from the specified a and b values.

constexpr
pair(
    bsl::add_lvalue_reference<T1 const>::type a,
    bsl::add_lvalue_reference<T2 const>::type b);
» more...

Copy original using basicAllocator to supply memory.

pair(
    pair const& original,
    BloombergLP::bslma::Allocator* basicAllocator);
» more...

Move original using basicAllocator to supply memory.

pair(
    pair&& original,
    BloombergLP::bslma::Allocator* basicAllocator);
» more...

Construct a pair from other, using basicAllocator.

template<
    class PARAM_1,
    class PARAM_2>
pair(
    pair<PARAM_1, PARAM_2> const& other,
    BloombergLP::bslma::Allocator* basicAllocator);
» more...

Construct a pair from the std::pair other, using basicAllocator.

template<
    class PARAM_1,
    class PARAM_2>
pair(
    std::pair<PARAM_1, PARAM_2> const& other,
    BloombergLP::bslma::Allocator* basicAllocator);
» more...

Construct a pair from the specified rvalue other pair.

template<
    class PARAM_1,
    class PARAM_2>
pair(
    pair<PARAM_1, PARAM_2>&& other,
    BloombergLP::bslma::Allocator* basicAllocator);
» more...

Construct a pair from the rvalue other, using basicAllocator.

template<
    class PARAM_1,
    class PARAM_2>
pair(
    std::pair<PARAM_1, PARAM_2>&& other,
    BloombergLP::bslma::Allocator* basicAllocator);
» more...

Construct a pair from the specified a and b values.

template<
    class PARAM_1,
    class PARAM_2,
    class = void>
requires std::is_constructible<T1, PARAM_1>::value &&
                std::is_constructible<T2, PARAM_2>::value &&
                !(bsl::is_pointer<bsl::remove_reference_t<PARAM_2>>::value &&
                  bsl::is_convertible<PARAM_2,
                                      BloombergLP::bslma::Allocator *>::value)
constexpr
pair(
    PARAM_1&& a,
    PARAM_2&& b);
» more...

Create a pair from the specified a and b lvalue references.

pair(
    bsl::add_lvalue_reference<T1 const>::type a,
    bsl::add_lvalue_reference<T2 const>::type b,
    BloombergLP::bslma::Allocator* basicAllocator);
» more...

Construct first and second piece-wise from tuples of arguments.

template<
    class... ARGS_1,
    class... ARGS_2>
pair(
    std::piecewise_construct_t tag,
    std::tuple<ARGS_1...> first_args,
    std::tuple<ARGS_2...> second_args);
» more...

Construct a pair from a and b, using basicAllocator.

template<
    class PARAM_1,
    class PARAM_2>
pair(
    PARAM_1&& a,
    PARAM_2&& b,
    BloombergLP::bslma::Allocator* basicAllocator);
» more...

Same as the preceding constructor, using the specified basicAllocator to supply memory.

template<
    class... ARGS_1,
    class... ARGS_2>
pair(
    std::piecewise_construct_t tag,
    std::tuple<ARGS_1...> first_args,
    std::tuple<ARGS_2...> second_args,
    BloombergLP::bslma::Allocator* basicAllocator);
» more...

Parameters

NameDescription
otherpair whose members initialize this pair's members
basicAllocatorallocator used to supply memory
rhspair proxy whose members initialize this pair's members
avalue copied into the first member
bvalue copied into the second member
originalpair whose value is copied
tagtag selecting piece-wise construction
first_argstuple of arguments forwarded to the constructor of T1
second_argstuple of arguments forwarded to the constructor of T2