title: error: use of deleted function ‘std::atomic<_Tp>::atomic()
body: <p>I got this code in cpp (it is a minimal example where I get the error):</p>
  
  <pre><code>#include &lt;cstdio&gt;
  #include &lt;functional&gt;
  #include &lt;iostream&gt;
  #include &lt;atomic&gt;
  
  const int N = 128;
  
  template &lt;typename T&gt; struct Element {
      const T * key{nullptr};
      bool occupied{false};
  
      Element( const T* key, bool occupied ) : key( key ), occupied( occupied ) {}
      Element() : key{}, occupied{} {}
  };
  
  template &lt;typename T&gt;
  class AtomicHashSet {
      std::atomic&lt;Element&lt;T&gt;&gt; table[N];
  
  public:
      AtomicHashSet() : table{} {}
  
      size_t hash( const T&amp; key ) const {
          return std::hash&lt;const T&gt;()( &amp;key );
      }
  
      bool insert( const T&amp; key ) {
          Element&lt;T&gt; e{};
          e.key = &amp;key;
          e.occupied = true;
  
          for ( size_t i = 0; i &lt; N; ++i ) {
              size_t idx = ( hash( key ) + i ) % N;
  
              Element&lt;T&gt; empty{};
              if ( table[idx].compare_exchange_strong( empty, e ) ) {
                  return true;
              }
              else if ( table[idx].load().key == &amp;key ) {
                  return false;
              }
          }
          return false;
      }
  };
  
  int main() {
      AtomicHashSet&lt;int&gt; set;
      int one = 1;
      std::cout &lt;&lt; "insert hello 1: " &lt;&lt; set.insert(one) &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  
  <p>The error is shown as follows:</p>
  
  <pre><code>error: use of deleted function ‘std::atomic&lt;_Tp&gt;::atomic() [with _Tp = Element&lt;int&gt;]’
       AtomicHashSet() : table{} {}
  </code></pre>
  
  <p>I had the same error before at a different line because I forgot the default constructor in the 'Element' struct. What did I wrong this time?</p>
  
  <p>Can someone help me here? Thanks alot!</p>