std::packaged_task::valid(3)

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

✨ std::packaged_task::valid ✨

okay so real talk, this page comes straight out of the C++ Standard Libary manual (yes that's the manual name, we don't edit it, we respect it πŸ’…) and it's honestly one of the shortest reads ever. it's giving "one question, one answer" energy and i'm kinda obsessed.


🌸 NAME 🌸

std::packaged_task::valid β€” that's it, that's the whole name. it does exactly what it says on the tin, no cap.


πŸŽ€ Synopsis πŸŽ€

bool valid() const noexcept;  (since C++11)

so this lil member function checks whether *this has a shared state. that's the entire vibe check right there πŸ¦‹

it's been hanging out since C++11, and it's written const noexcept β€” i'm just reading the signature to you exactly as it appears, bestie, not adding my own lore ✨


πŸ’– Parameters πŸ’–

(none)

literally zero. nothing. no arguments, no surprises, she takes no notes πŸ™ˆ


⭐ Return value ⭐

  • true β€” if *this has a shared state πŸ”₯
  • false β€” otherwise πŸ’€

that's the whole deal. binary queen πŸ‘‘


so yeah, that's the page. iconic, brief, no filler. go check if your packaged_task actually has a shared state before you get weird with it, iykyk 🫢

this was brought to you by http://cppreference.com, version/date 2024.06.10 β€” mwah, love u, bye bestie! πŸ’œπŸŽ€πŸŒˆ

πŸ“¦ where this page comes from