2.1 KiB
[optional.specalg]
22 General utilities library [utilities]
22.5 Optional objects [optional]
22.5.10 Specialized algorithms [optional.specalg]
template<class T> constexpr void swap(optional<T>& x, optional<T>& y) noexcept(noexcept(x.swap(y)));
Constraints: is_reference_v || (is_move_constructible_v && is_swappable_v) is true.
Effects: Calls x.swap(y).
template<class T> constexpr optional<decay_t<T>> make_optional(T&& v);
Constraints: The call to make_optional does not use an explicit template-argument-list that begins with a type template-argument.
Returns: optional<decay_t>(std::forward(v)).
template<class T, class...Args> constexpr optional<T> make_optional(Args&&... args);
Effects: Equivalent to: return optional(in_place, std::forward(args)...);
template<class T, class U, class... Args> constexpr optional<T> make_optional(initializer_list<U> il, Args&&... args);
Effects: Equivalent to: return optional(in_place, il, std::forward(args)...);