make_optional overloads
Declared in <beman/optional/optional.hpp>
Creates an optional holding a decayed copy of the given value.
template<
int = 0,
class T>
constexpr
optional<std::decay_t<T>>
make_optional(T&& t) noexcept(/* see-below */)
requires std::is_constructible_v<std::decay_t<T>, T>;
» more...
Creates an optional<T> constructing the value in-place from the given arguments.
template<
typename T,
typename... Args>
constexpr
optional<T>
make_optional(Args&&... args) noexcept(/* see-below */)
requires std::is_constructible_v<T, Args...>;
» more...
Creates an optional<T> constructing the value in-place from an initializer list and arguments.
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...>;
» more...
t.| Name | Description |
|---|---|
| t | The value to store in the returned optional. |
| args | The arguments forwarded to the constructor of T. |
| il | The initializer list forwarded to the constructor of T. |