once_flag Structure
Represents a struct
that is used with the template function call_once to ensure that initialization code is called only once, even in the presence of multiple threads of execution.
Syntax
struct once_flag
{
constexpr once_flag() noexcept;
};
Remarks
The once_flag
struct
has only a default constructor.
Objects of type once_flag
can be created, but they cannot be copied.
Requirements
Header: <mutex>
Namespace: std
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for