title: difference between standard's atomic bool and atomic flag
body: <p>I wasn't aware of the <code>std::atomic</code> variables but was aware about the <code>std::mutex</code> (weird right!) provided by the standard; however one thing caught my eye: there are two seemingly-same (to me) atomic types provided by the standard, listed below:</p>
  
  <ol>
  <li><p><a href="http://en.cppreference.com/w/cpp/atomic/atomic" rel="noreferrer"><code>std::atomic&lt;bool&gt;</code></a></p></li>
  <li><p><a href="http://en.cppreference.com/w/cpp/atomic/atomic_flag" rel="noreferrer"><code>std::atomic_flag</code></a></p></li>
  </ol>
  
  <p>The <code>std::atomic_flag</code> contains the following explanation:</p>
  
  <blockquote>
    <p><code>std::atomic_flag</code> is an atomic boolean type. Unlike all specializations of <code>std::atomic</code>, it is guaranteed to be lock-free. Unlike <code>std::atomic&lt;bool&gt;</code>, <code>std::atomic_flag</code> does not provide load or store operations.</p>
  </blockquote>
  
  <p>which I fail to understand. Is <code>std::atomic&lt;bool&gt;</code> not guaranteed to be lock-free? Then it's not atomic or what?</p>
  
  <p>So what's the difference between the two and when should I use which?</p>