std::experi...::~optional(3)

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

πŸ’– std::experimental::optional::~optional πŸ’–

bestie, this page is from the C++ Standard Libary manual β€” yes, that spelling is in the original, leave her alone 😭 β€” and it's the destructor page for std::experimental::optional. it's giving cleanup era, closure, and dramatic exits. πŸ’…


🌸 NAME 🌸

std::experimental::optional::~optional -
std::experimental::optional::~optional

✨ Synopsis ✨

~optional();  (library fundamentals TS)

okay so here's the vibe: if the object contains a value and the type T is not trivially destructible (peep std::is_trivially_destructible), it destroys the contained value by calling its destructor, as if by val->T::~T(). otherwise? it does nothing. literally nothing. a little nap. 😴

πŸŽ€ Notes πŸŽ€

if T is trivially-destructible, then this destructor is also trivial, so optional<T> is also trivially-destructible. slay for compile-time efficiency, bestie. ✨

πŸ¦‹ Category πŸ¦‹

  • Noindexed pages

source + version/date folded into this cute sign-off: http://cppreference.com, 2024.06.10 β€” periodt, that's the footer info. bye bestie, go destroy some contained values (only when appropriate) πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from