title: what is the difference between ++, add operation and fetch_add() in atomic()
body: <p>I ran following code many times but why the result for   prefix increment , fetch_add() shows the correct result  while with add operation (+), it  prints the wrong result? </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;mutex&gt;
  #include &lt;future&gt;
  using namespace std;
  atomic &lt;int&gt; cnt (0);
  void fun()
  {
      for(int i =0; i &lt;10000000 ; ++i)
      {
         //++cnt; // print the correct result 20000000 
         //cnt = cnt+1; // print wrong result, arbitrary numbers 
         cnt.fetch_add(1); //  print the correct result 20000000 
      }
  }
  int main()
  {
      auto fut1 = async(std::launch::async, fun);
      auto fut2 = async(std::launch::async, fun);
      fut1.get();
      fut2.get();
      cout &lt;&lt; "value of cnt: "&lt;&lt;cnt &lt;&lt;endl;
  
  } 
  </code></pre>