title: Insert Objects into Vector when Class Has Constants
body: <p>Say I have a class that has only constants, since the values should never change.</p>
  
  <pre><code>struct Test {
      const std::string id;
      const int a;
      const double b;
  };
  </code></pre>
  
  <p>Later on, I want to add objects into a vector, but I want the vector to be sorted by <code>b</code> from largest to smallest. I use insertion sort, since there will only ever be a small number (maybe 5).</p>
  
  <pre><code>std::vector&lt;Test&gt; values;
  
  void addValue( const std::string &amp;id, int a, double b ) {
      // Keep stockpiles sorted by weight (large to small)
      auto itr = values.begin();
      while ( itr != values.end() &amp;&amp; itr-&gt;b &gt; b ) ++itr;
      values.insert( itr, { id, a, b } );
      // end sort
  }
  </code></pre>
  
  <p>Attempting the above, I get the following error while attempting to insert into the vector:</p>
  
  <blockquote>
    <p>error: object of type 'Test' cannot be assigned because its copy assignment operator is implicitly deleted</p>
  </blockquote>
  
  <p>I would like to keep with using a <code>vector</code> for this problem; but I can't seem to find a way around the sorting issue. The only other option I could think of was to effectively recreate the <code>vector</code> constantly. Alternatively, using a <code>multi-set</code> or similar, then once all values are added, I could dump into an array.</p>
  
  <p>Is there a way around this limitation, still using a <code>vector</code> and not making everything non-const? Or will I be forced to change my structure, or move away into a temporary object first?</p>
  
  <p>Edit: Also trying to avoid the use of pointers</p>