bsl::optional::optional

Create an optional object having the value of the (template parameter) t_TYPE created in place using the specified args.

Synopsis

Declared in <bslstl_optional.h>

template<class... t_ARGS>
constexpr
explicit
optional(
    std::in_place_t inPlace,
    t_ARGS&&... args);

Description

Create an optional object having the value of the (template parameter) t_TYPE created in place using the specified args. Use the currently installed default allocator to supply memory. This constructor can be called in constant expressions only when t_TYPE is not allocator-aware.

Parameters

NameDescription
inPlacetag selecting in-place construction of the contained
argsarguments forwarded to construct the contained value value