title: How to properly use shared pointer member of a struct?
body: <p>I have a struct containing a shared_ptr to a vector. In my code I am getting 3 errors related to this:</p>
  
  <ul>
  <li><blockquote>
    <p>At this line, <code>
        newtickerDiary t;
        t.dataPtr-&gt;reserve(MAX_OHLC_ENTRIES);
        tDiaries[token] = t;</code> <br/> I get this error: <br/> <strong>function "newtickerDiary::operator=(const newtickerDiary &amp;)" (declared
    implicitly) cannot be referenced -- it is a deleted function</strong></p>
  </blockquote></li>
  <li><blockquote>
    <p>At this line,<br /><code>QuotationWTime &amp;prevQ = tDiaries[token].dataPtr[size -&gt; 1];</code><br /> I get the following error: <br />
    <strong>no operator "[]" matches these operands</strong></p>
  </blockquote></li>
  <li><blockquote>
    <p>At this line,<br /> <code>for (auto x : tDiaries)
           {
               x.second.updatesOn = false;
           }</code><br /> I get the following error: <br /> <strong>function "std::pair&lt;_Ty1, _Ty2>::pair(const std::pair&lt;_Ty1, _Ty2> &amp;) [with _Ty1=const std::string, _Ty2=newtickerDiary]" (declared at line 133 of "C:\Program Files (x86)\Microsoft Visual
    Studio\2019\Community\VC\Tools\MSVC\14.21.27702\include\utility")
    cannot be referenced -- it is a deleted function</strong></p>
  </blockquote></li>
  </ul>
  
  <p>Following are relevant data containers/types:</p>
  
  <pre><code>typedef int16_t int16;
  typedef int32_t int32;
  
  struct QuotationWTime {
      union AmiDate DateTime; // 8 byte
      float   Price;
      float   Open;
      float   High;
      float   Low;
      float   Volume;
      float   OpenInterest;
      float   AuxData1;
      float   AuxData2;
  };
  
  struct newtickerDiary {
      string name = ""; //AmiBroker scrip name
      string ohlcPeriodicity = "minute"; //interval of fetched OHLC data
      bool ohlcStatus = false; //updated initially. Will be set to 0 upon plugin initialization
      bool rtStatus = false;//updated initially. Will be set to 0 upon plugin initialization
      bool updatesOn = true;
      int32 ohlcDayBarIndex = 0; //last updated bar
      shared_ptr&lt;vector&lt;QuotationWTime&gt;&gt; dataPtr = std::make_shared&lt;std::vector&lt;QuotationWTime&gt;&gt;();
      mutex dataMutex;
  };
  
  unordered_map&lt;string, newtickerDiary&gt; tDiaries;
  </code></pre>
  
  <p>I need help to figure out how to resolve these errors.</p>