std::experi...ke_optional(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– std::experi...ke_optional(3) πŸ’–

okay bestie, welcome to the std::experi...ke_optional(3) page from the C++ Standard Libary manual. yes, that manual name is staying exactly like that, and yes, this helper is lowkey iconic. πŸ¦‹


πŸŽ€ NAME πŸŽ€

std::experimental::make_optional β€” std::experimental::make_optional. yep, same name on both sides, she's consistent like that πŸ’…

✨ Synopsis ✨

Defined in header <experimental/optional>

template< class T >

constexpr optional<typename std::decay<T>::type>  (library
fundamentals TS)

    make_optional( T&& value );

Creates an optional object from value. Effectively calls optional<typename std::decay<T>::type>(std::forward<T>(value)). no cap, that's the whole move 🌸

🫢 Parameters 🫢

  • value β€” the value to construct optional object with πŸ’–

🌟 Return value 🌟

An optional object with value as the contained value. slay. ✨

πŸ’€ Exceptions πŸ’€

Throws any exception thrown by the constructor of T. so if T's constructor gets dramatic, this function gets dramatic right back 😭

πŸ‘‘ See also πŸ‘‘

  • constructor β€” constructs the optional object (public member function) πŸŽ€

🌈 Category 🌈

  • Noindexed pages πŸ¦‹

source/version/date vibe check, bestie: http://cppreference.com β€’ 2024.06.10 β€’ std::experi...ke_optional(3) πŸ«ΆπŸ’…

πŸ“¦ where this page comes from