std::unexpe...td::unexpect(3)

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

πŸŽ€ NAME πŸŽ€

okay so this page is about std::unexpect_t and std::unexpect, from the C++ Standard Libary (yes, the original header spells it β€œLibary” β€” we are keeping the typo energy πŸ’…). It’s the tag-type-and-constant situation for making an std::expected hold an unexpected value, iykyk. πŸ¦‹


✨ Synopsis ✨

bestie, here’s the exact declaration vibe check:

Defined in header <expected>
struct unexpect_t {

    explicit unexpect_t() = default;    (1) (since C++23)

};
inline constexpr unexpect_t unexpect{}; (2) (since C++23)
  1. A tag type for in-place construction of an unexpected value in an std::expected object. 🏷️
  2. A constant of type const std::unexpect_t which is usually directly passed to a constructor of std::expected to construct an unexpected value. 🎁

πŸ’… Notes πŸ’…

Like other construction tag types, unexpect_t is a trivial, empty class with an explicit default constructor. No cap, that’s literally the note. ✨


πŸ¦‹ See also πŸ¦‹

  • constructor β€” constructs the expected object (public member function)
  • in_place, in_place_type, in_place_index β€” in-place construction tag
  • in_place_t, in_place_type_t, in_place_index_t β€” (tag) (C++17)

and that’s the whole page, bestie 🫢. cute little sign-off: it’s sourced from http://cppreference.com, dated 2024.06.10, and the footer title is std::unexpe...td::unexpect(3) ✨

πŸ“¦ where this page comes from