title: error: use of deleted function ‘std::atomic<_Tp>::atomic() [with _Tp = node]’
body: <p>Having compile issue when using atomic with class based.</p>
  
  <p>error: use of deleted function ‘std::atomic&lt;_Tp>::atomic() [with _Tp = node]’
       stack() {
               ^</p>
  
  <p>/usr/include/c++/5/atomic:185:7: note: ‘std::atomic&lt;_Tp>::atomic() noexcept [with _Tp = node]’ is implicitly deleted because its exception-specification does not match the implicit exception-specification ‘’
         atomic() noexcept = default;
         ^</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;atomic&gt;
  #include &lt;cstdlib&gt;
  #include &lt;memory&gt;
  
  class node
  {
  private:
      int data;
      bool hasTransaction;
  public:    
      node(int&amp; data) : data(data), hasTransaction(true) {}
      node() : data(10), hasTransaction(true) {}
  };
  
  class stack {
      std::atomic&lt;node&gt; head;
  public:
      void push(int data) {
          node new_node(data);
  
          node current = head.load(std::memory_order_relaxed);
  
          while (!head.compare_exchange_strong(
                      current,
                      new_node,
                      std::memory_order_release,
                      std::memory_order_relaxed))
              ;
      }
  
      stack() {
          node a;
          std::atomic_init(&amp;head, a);
          head.store(a);
      };
  };
  
  int main()
  {
      stack s;
      s.push(1);
      s.push(2);
      s.push(3);
  }
  </code></pre>