BloombergLP::bdlb::VariantImp::createInPlace

Emplace a TYPE instance constructed from arguments.

Synopsis

Declared in <bdlb_variant.h>

template<
    class TYPE,
    class... ARGS>
TYPE&
createInPlace(ARGS&&... arguments);

Description

This method first destroys the current value held by this variant (even if TYPE is the same as the type currently held). TYPE must be the same as one of the types that this variant can hold. Note the order of the template arguments was chosen so that TYPE must always be specified.

Return Value

reference providing modifiable access to the emplaced TYPE value

Parameters

NameDescription
argumentsconstructor arguments forwarded to TYPE