BloombergLP::bslstl::Optional_DataImp::emplace

Destroy any contained value and construct a new one in place.

Synopses

Declared in <bslstl_optional.h>

Destroy any contained value and construct a new one in place.

template<class... t_ARGS>
t_TYPE&
emplace(
    bslma::Allocator* allocator,
    t_ARGS&&... args);
» more...

Destroy any contained value and construct a new one in place.

template<
    class t_INIT_LIST_TYPE,
    class... t_ARGS>
t_TYPE&
emplace(
    bslma::Allocator* allocator,
    std::initializer_list<t_INIT_LIST_TYPE> initializer_list,
    t_ARGS&&... args);
» more...

Return Value

reference providing modifiable access to the contained value

Parameters

NameDescription
allocatorallocator used to supply memory
argsarguments forwarded to construct the contained value
initializer_listinitializer list forwarded to construct the contained value