Create a variant object holding a t_TYPE alternative from il and args.

Synopsis

Declared in <bslstl_variant.h>

template<
    class t_TYPE,
    class INIT_LIST_TYPE,
    class... t_ARGS>
requires BSLSTL_VARIANT_HAS_UNIQUE_TYPE(t_TYPE) &&
                  std::is_constructible<t_TYPE,
                                        std::initializer_list<INIT_LIST_TYPE>&,
                                        t_ARGS...>::value
explicit
variant(
    bsl::in_place_type_t<t_TYPE> inPlaceType,
    std::initializer_list<INIT_LIST_TYPE> il,
    t_ARGS&&... args);

Description

Create a variant object holding a contained value of type (template parameter) t_TYPE, direct‐initialized from the specified il and args. If this variant is allocator‐aware, the currently installed default allocator is used to supply memory. This constructor participates in overload resolution only if t_TYPE designates a unique alternative and is constructible from il and args. For simplicity of implementation, this method differs from the standard in the following way: * constexpr is not implemented

Parameters

Name

Description

inPlaceType

tag selecting the t_TYPE alternative

il

initializer list used to construct the t_TYPE alternative

args

additional arguments used to construct the alternative

Created with MrDocs