Create a disengaged optional object if the specified original object is disengaged, and an optional object with the value of original.value() converted to t_TYPE otherwise. Use the currently installed default allocator to supply memory. Note that this constructor participates in overload resolution only when t_TYPE is constructible from an lvalue of const t_ANY_TYPE, and is explicit only when an lvalue of const t_ANY_TYPE is not implicitly convertible to t_TYPE. This constructor can be called in constant expressions only when t_TYPE is not allocator‐aware.

Synopsis

Declared in <bslstl_optional.h>

template<class t_ANY_TYPE>
constexpr
explicit
optional(std::optional<t_ANY_TYPE> const& original);

Created with MrDocs