This topic has not yet been rated - Rate this topic

once_flag Structure

Visual Studio 2012

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.

struct once_flag
{
   constexpr once_flag() noexcept;
   once_flag(const once_flag&);
   once_flag& operator=(const once_flag&);
};

The once_flag struct has only a default constructor.

Objects of type once_flag can be created, but they cannot be copied.

Header: mutex

Namespace: std

Reference

Other Resources

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.