make_optional overloads
Declared in <absl/types/optional.h>
Creates an optional holding a copy of the given value.
template<typename T>
constexpr
decltype(std::make_optional(
std::declval<T>()))
make_optional(T&& value);
» more...
Creates an optional<T> by constructing T in place.
template<
typename T,
typename... Args>
constexpr
decltype(std::make_optional<T>(
std::declval<Args>()...))
make_optional(Args&&... args);
» more...
Creates an optional<T> from an initializer list and extra arguments.
template<
typename T,
typename U,
typename... Args>
constexpr
decltype(std::make_optional<T>(
std::declval<std::initializer_list<U>>(),
std::declval<Args>()...))
make_optional(
std::initializer_list<U> il,
Args&&... args);
» more...
| Name | Description |
|---|---|
| value | The value to store in the returned optional. |
| args | Arguments forwarded to the constructor of T. |
| il | Initializer list forwarded to the constructor of T. |