ATOMIC_FLAG_INIT
From cppreference.com
Template:ddcl list begin <tr class="t-dsc-header">
<td>Defined in header
</td>
<atomic>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td class="t-dcl-nopad">#define ATOMIC_FLAG_INIT /* implementation-defined */
</td>
<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end
Defines the expression which can be used to initialize std::atomic_flag to clear state. If the flag has static storage duration, this initialization is static.
Example
Run this code
#include <atomic> std::atomic_flag static_flag = ATOMIC_FLAG_INIT; int main() { std::atomic_flag automatic_flag = ATOMIC_FLAG_INIT; std::atomic_flag another_flag(ATOMIC_FLAG_INIT); }