title: How to use a mutex as a member variable? Without copy constructor of 'simple_encoder' is implicitly deleted
body: <p>Hello I am trying to create a multi-thread encoder, which needs a mutex and I would like that mutex to be a member of the class. However, I keep getting: <code>copy constructor of 'simple_encoder' is implicitly deleted because field 'm_mutex' has an inaccessible copy constructor</code> as an error message when I compile. After a hour of so of searching I cannot find my mistake. </p>
  
  <p>Please for the love of something help me, my constructor and members look like this: </p>
  
  <pre><code>namespace master_thesis
  {
  class simple_encoder
  {
  public:
  
      simple_encoder(uint32_t symbols, uint32_t symbol_size, fifi::api::field field,
                     std::vector&lt;uint8_t&gt; data) :
          m_symbols(symbols), m_symbol_size(symbol_size),
          m_completed(0), m_field(field), m_data(data)
      {
  
      }
  ...
  private:
  
      uint32_t m_symbols;
      uint32_t m_symbol_size;
      uint32_t m_completed; 
  
      fifi::api::field m_field;
  
      std::mutex m_mutex;
  
      std::vector&lt;uint8_t&gt; m_data;
      std::vector&lt;std::vector&lt;uint8_t&gt;&gt; m_result;
  
      std::vector&lt;std::shared_ptr&lt;kodo_rlnc::full_vector_encoder&gt;&gt; m_encoders;
  };
  }
  </code></pre>