std::set_unexpected(3)

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

🌸 NAME 🌸

std::set_unexpected β€” std::set_unexpected πŸ’–

okay so this is the page for std::set_unexpected(3) from the C++ Standard Libary manual β€” yes bestie, that spelling is exactly what the manual name says 😭✨

✨ Synopsis ✨

First up, it's defined in header <exception> πŸŽ€

until C++11:

std::unexpected_handler set_unexpected( std::unexpected_handler f ) throw();

since C++11:

std::unexpected_handler set_unexpected( std::unexpected_handler f ) noexcept;
deprecated and removed in C++17 β€” not a drill, bestie πŸ’€

It makes f the new global std::unexpected_handler and returns the previously installed std::unexpected_handler 🫢

This function is thread-safe. Every call to std::set_unexpected synchronizes-with (see std::memory_order) the subsequent calls to std::set_unexpected and std::get_unexpected (since C++11) ✨

πŸŽ€ Parameters πŸŽ€

  • f β€” pointer to function of type std::unexpected_handler, or null pointer πŸ’…

πŸ’– Return value πŸ’–

The previously-installed unexpected handler, or a null pointer value if none was installed. periodt. 🫢

πŸ¦‹ See also πŸ¦‹

  • unexpected (removed in C++17) β€” function called when dynamic exception specification is violated (function)
  • get_unexpected (C++11)(removed in C++17) β€” obtains the current unexpected_handler (function)
  • unexpected_handler (removed in C++17) β€” the type of the function called by std::unexpected (typedef)

okay bestie, that's the whole page πŸ’– source: http://cppreference.com, version/date: 2024.06.10, page std::set_unexpected(3) β€” you ate this one, no cap πŸ‘‘πŸŒˆ

πŸ“¦ where this page comes from