title: How to do deep copy by overloaded assignment operator of subclass of std::vector<T>?
body: <p>I have a class <code>Step</code> derived from <code>std::vector&lt;unsigned int&gt;</code>. I need to overload assignment operator because of the deep copy used in assignment of a value returned from a static method. I can't figur out how should I copy all elements of <code>rhv</code> to <code>this</code> in assignment:</p>
  
  <pre><code>class Step : public std::vector&lt;unsigned int&gt;
  {
  public:
      friend std::ostream&amp; operator&lt;&lt;(std::ostream&amp; outStream, const Step&amp; step);
      Step&amp; operator =(const Step&amp; rhv);
      static Step fromString(const std::string &amp;input);
      // Something like: Step x = Step::fromString("12 13 14 15 16");
  private:
      double time;
      double pause;
      unsigned int id;
      std::string name;
  };
  </code></pre>
  
  <p>and then overloading <code>=</code>:</p>
  
  <pre><code>Step&amp; Step::operator =(const Step&amp; rhv)
  {
      time = rhv.time;
      pause = rhv.pause;
      id = rhv.id;
      // How should I copy contents of rhv to `this` safely?
      return *this;
  }
  </code></pre>