std::once_flag(3cxx)

🌸 NAME 🌸

okay so bestie, welcome to the 3cxx manual page for std::once_flag πŸ’… β€” literally std::once_flag - Flag type used by std::call_once. No cap, that's the whole name vibe. 🫢

✨ SYNOPSIS ✨

First move: grab the header, bestie:

#include <mutex>

πŸ’… Public Member Functions

  • once_flag (const once_flag &)=delete β€” Deleted copy constructor. the copy constructor is deleted, so no sneaky copies, periodt πŸš«πŸ’€
  • once_flag & operator= (const once_flag &)=delete β€” Deleted assignment operator. assignment is deleted too, it's giving "not available" energy πŸ™ˆ

🫢 Friends

  • template<typename _Callable , typename... _Args> void call_once (once_flag &__once, _Callable &&__f, _Args &&... __args) β€” Invoke a callable and synchronize with other calls using the same flag. friend privileges, synchronized slay ✨

πŸ’– Detailed Description πŸ’–

Flag type used by std::call_once. That's it, that's the description β€” short and iconic πŸ‘‘.

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

std::once_flag::once_flag (const once_flag &) [delete]

Deleted copy constructor. yep, deleted fr fr β€” the copy constructor said "not today" and honestly? valid πŸ™ˆ.

πŸ¦‹ Member Function Documentation πŸ¦‹

once_flag & std::once_flag::operator= (const once_flag &) [delete]

Deleted assignment operator. no assignment arc for this one, it's deleted, periodt πŸ’€.

template<typename _Callable , typename... _Args> void call_once (once_flag & __once, _Callable && __f, _Args &&... __args) [friend]

Invoke a callable and synchronize with other calls using the same flag. bestie behavior: call once and keep it coordinated with everyone using the same flag 🫢✨

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. iconic automated author energy, no cap πŸ‘‘.


k bye bestie πŸ’– β€” huge source/version shoutout to libstdc++, footer vibe is std::once_flag(3cxx), and the date? not printed in this footer, so I'm not inventing one πŸ™ˆπŸ«Ά.

πŸ“¦ where this page comes from