Creates an optional<T> constructing the value in-place from an initializer list and arguments.
Declared in <beman/optional/optional.hpp>
template<
typename T,
typename U,
typename... Args>
constexpr
optional<T>
make_optional(
std::initializer_list<U> il,
Args&&... args) noexcept(/* see-below */)
requires std::is_constructible_v<T, std::initializer_list<U>&, Args...>;
This function is potentially-throwing unless std::is_nothrow_constructible_v<T, std::initializer_list<U> &, Args...>.
An engaged optional<T> holding the in-place constructed value.
| Name | Description |
|---|---|
| il | The initializer list forwarded to the constructor of T. |
| args | The additional arguments forwarded to the constructor of T. |