Constructors
Declared in <folly/Optional.h>
Default-constructed Optionals are None.
constexpr
Optional() noexcept;
» more...
Copy-constructs an Optional from another Optional.
Optional(Optional const& src) = default;
» more...
Move-constructs an Optional, leaving the source empty.
Optional(Optional&& src) noexcept(/* see-below */);
» more...
Constructs an empty Optional from a None tag.
constexpr
Optional(None const& none) noexcept;
» more...
Constructs an Optional by copying a value into it.
constexpr
Optional(Value const& newValue) noexcept(/* see-below */);
» more...
Constructs an Optional from a coroutine promise return object.
Optional(/* implementation-defined */ const& p);
» more...
Constructs an Optional by moving a value into it.
constexpr
Optional(Value&& newValue) noexcept(/* see-below */);
» more...
Allow construction of Optional from a const std::optional.
template<typename U>
requires std::same_as<U, std::optional<Value>>
explicit
Optional(U const& newValue) noexcept(/* see-below */);
» more...
Allow construction of Optional from an rvalue std::optional.
template<typename U>
requires std::same_as<U, std::optional<Value>>
explicit
Optional(U&& newValue) noexcept(/* see-below */);
» more...
Creates an Optional with a value, where that value is constructed in-place.
template<typename... Args>
constexpr
explicit
Optional(
std::in_place_t in_place,
Args&&... args) noexcept(/* see-below */);
» more...
Creates an Optional with a value constructed in-place from an initializer list.
template<
typename U,
typename... Args>
constexpr
explicit
Optional(
std::in_place_t in_place,
std::initializer_list<U> il,
Args&&... args) noexcept(/* see-below */);
» more...
| Name | Description |
|---|---|
| src | The Optional to copy from. |
| none | The None tag selecting the empty state. |
| newValue | The value to copy into the Optional. |
| p | The coroutine promise return object to bind to. |
| in_place | Tag selecting in-place construction. |
| args | Arguments forwarded to the value constructor. |
| il | Initializer list forwarded to the value constructor. |