title: Consecutive, distinct sequences in C++ 11 using Atomic
body: <p>I have two questions about atomics:</p>
  
  <p>1) Is the following code guaranteed to return consecutive, monotonically increasing sequences without duplicates in a multi-threaded setup?</p>
  
  <pre><code>#include &lt;atomic&gt;
  
  struct AtomicCounter {
      std::atomic&lt;int&gt; value;
  
      AtomicCounter() : value( 0 ) {}
  
      int getNextSequence(){
      return ++value;
      }
  };
  </code></pre>
  
  <p>2) Is there a simpler way to initialize? None of these worked: </p>
  
  <pre><code>std::atomic&lt;int&gt; value ( 0 ) ;
  std::atomic&lt;int&gt; value { 0 } ;
  std::atomic&lt;int&gt; value=0;
  </code></pre>
  
  <p>Thanks in advance</p>