title: error C2248 while using std::atomic<bool>::atomic
body: <p>Firstly, pardon me for the long post.</p>
  
  <p>I am using boost::lockfree::spsc_queue to run on two separate threads to process FIX messages. I am using quickfix for converting FIX strings from a file to convert to FIX Messages. I want to be able to pass the queue as a pointer to both threads and a boolean value that indicates whether there are still messages to be processes. </p>
  
  <p>I am getting the following error:</p>
  
  <p>Please refer the code below.</p>
  
  <p>It is based of an example in boost documentation. (Waitfree Single-Producer/Single-Consumer Queue)</p>
  
  <p><a href="http://www.boost.org/doc/libs/1_55_0/doc/html/lockfree/examples.html" rel="nofollow">http://www.boost.org/doc/libs/1_55_0/doc/html/lockfree/examples.html</a></p>
  
  <p>I have been trying different ways to transfer the value of running and pqFixMessages to the two threads but nothing seams to work as of now. I will appreciate any suggestions.</p>
  
  <pre><code>'std::atomic&lt;bool&gt;::atomic' : cannot access private member declared in class 'std::atomic&lt;bool&gt;
  </code></pre>
  
  <p>Description:</p>
  
  <p>Producer thread reads a file, creates FIX messages and pushes them in the queue.</p>
  
  <p>Consumer thread reads the queue and processes these messages. As of now, I am just displaying the session id's for debugging.</p>
  
  <p>Main has a pointer to the queue that is passed on to both the threads. </p>
  
  <p>Further Context: After this works, I want producer and consumer to be separate classes.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;thread&gt;
  #include &lt;atomic&gt;
  #include &lt;fstream&gt;
  #include &lt;quickfix\Message.h&gt;
  #include &lt;boost\lockfree\spsc_queue.hpp&gt;
  
  
  using namespace std;
  using namespace boost::lockfree;
  
  void producer(spsc_queue&lt;FIX::Message, capacity&lt;1024&gt;&gt; * pqFixMessages, std::atomic&lt;bool&gt; running) {
      std::string line;
      std::ifstream fixMessageStream(&lt;filename&gt;);
      FIX::Message currentMessage;
      while (fixMessageStream) {
          std::getline(fixMessageStream, line);
          try {
              // Erases the timestamp on messages
              currentMessage = FIX::Message(line.erase(0, 25));
              pqFixMessages-&gt;push(currentMessage);
          } catch (std::exception&amp; ex) {
          }
      }
      running = false;
  }
  
  std::atomic&lt;bool&gt; done(false); 
  
  void consumer(spsc_queue&lt;FIX::Message, capacity&lt;1024&gt;&gt; * pqFixMessages, std::atomic&lt;bool&gt; running) {
      FIX::Message frontOfTheQueueMessage;
      while(!pqFixMessages-&gt;empty() || running) {
          if (!pqFixMessages-&gt;empty()) {
              pqFixMessages-&gt;pop(frontOfTheQueueMessage);
              cout &lt;&lt; frontOfTheQueueMessage.getSessionID() &lt;&lt; endl;
          }
      }
  }
  
  int main(int argc, char * argv[]) {
  
      spsc_queue&lt;FIX::Message, capacity&lt;1024&gt;&gt; * pqFixMessages = 
          new spsc_queue&lt;FIX::Message, capacity&lt;1024&gt;&gt;();
  
      std::atomic&lt;bool&gt; running(true);
  
      thread producerThread(producer, pqFixMessages, ref(running));
      cout &lt;&lt; "Entered Producer Thread" &lt;&lt; endl;
      thread consumerThread(consumer, pqFixMessages, ref(running));
      cout &lt;&lt; "Entered Consumer Thread" &lt;&lt; endl;
  
      producerThread.join();
      cout &lt;&lt; "Joined Producer Thread" &lt;&lt; endl;
      done = true;
      consumerThread.join();
      cout &lt;&lt; "Joined Consumer Thread" &lt;&lt; endl;
  
      delete pqFixMessages;
  
      std::cin.get();
  
      return 0;
  </code></pre>
  
  <p>}</p>