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<T> || (is_move_constructible_v<T> && is_swappable_v<T>) 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.
Effects: Equivalent to: return optional<decay_t<T>>(std​::​forward<T>(v));
template<class T, class.Args> constexpr optional<T> make_optional(Args&&. args);
Effects: Equivalent to: return optional<T>(in_place, std​::​forward<Args>(args).);
template<class T, class U, class. Args> constexpr optional<T> make_optional(initializer_list<U> il, Args&&. args);
Effects: Equivalent to: return optional<T>(in_place, il, std​::​forward<Args>(args).);

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant