title: C++ atomic_flag query state
body: <p>I am using C++ <code>std::atomic_flag</code> as an atomic Boolean flag. Setting the flag to true or false is not a problem but how to query the current state of flag without setting it to some value? I know that there are methods '<code>atomic_flag_clear</code>' and '<code>atomic_flag_set</code>'. They do give back the previous state but also modify the current state. Is there any way to query flag state without modifying it or do I have to use full fledged '<code>std::atomic&lt;bool&gt;</code>'. </p>