title: Usages of std::move
body: <p>Below in the question is a simplified version of code for SO. The original code:</p>
  <ul>
  <li>Receives a structure that should not be modified or invalidated</li>
  <li>Creates a different structure that has some data copied from the original structure</li>
  <li>The newly created structure is intended to not be modifiable, all members are <code>const</code></li>
  <li>The newly created structure cannot have a constructor that knows about the original structure</li>
  </ul>
  <p>The simplified code for SO doesn't have the original structure, I just made up data with loops. However the detail which is still important is that the new structure's constructor will be passed <code>std::vector</code>. Those are populated in the loops and moved to the new structure</p>
  <p>It occurred to me that the <code>std::vector</code> will not be needed after the new structure is made so <code>std::move</code> would be appropriate. I have labeled the usages as &quot;Move 1&quot;, &quot;Move 2&quot;, &quot;Move 3&quot;, and &quot;Move 4&quot; in the code below:</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  struct A {
      const int m_a;
  
      A() = delete;
      A(const int a_a) : m_a(a_a) {}
  
      void display() const { std::cout &lt;&lt; &quot;    &quot; &lt;&lt; m_a &lt;&lt; &quot;\n&quot;; }
  };
  
  struct B {
      const std::vector&lt;A&gt; m_as;
      const int            m_b;
  
      B() = delete;
      B(
          std::vector&lt;A&gt;&amp;&amp; a_as,
          const int        a_b
      ) :
          m_as(std::move(a_as)), // Move 1
          m_b(a_b)
      {}
  
      void display() const {
          std::cout &lt;&lt; &quot;  &quot; &lt;&lt; m_b &lt;&lt; &quot;:\n&quot;;
          for (const A&amp; a : m_as)
              a.display();
      }
  };
  
  struct C {
      const std::vector&lt;B&gt; m_bs1;
      const std::vector&lt;B&gt; m_bs2;
  
      C() = delete;
      C(
          std::vector&lt;B&gt;&amp;&amp; a_bs1,
          std::vector&lt;B&gt;&amp;&amp; a_bs2
      ) :
          m_bs1(std::move(a_bs1)), // Move 2
          m_bs2(std::move(a_bs2))  // Move 2
      {}
  
      void display() const {
          std::cout &lt;&lt; &quot;0:\n&quot;;
          for (const B&amp; b : m_bs1)
              b.display();
          std::cout &lt;&lt; &quot;1:\n&quot;;
          for (const B&amp; b : m_bs2)
              b.display();
      }
  };
  
  int main() {
      // Manually making up data, actual usage will take data from a different
      // kind of structure and populate vectors
      std::vector&lt;B&gt; bs1, bs2;
      for (int i = 0; i &lt; 3; ++i) {
          std::vector&lt;A&gt; as;
          for (int j = 0; j &lt; 2; ++j)
              as.emplace_back(j);
          bs1.emplace_back(std::move(as), i); // Move 3
      }
      for (int i = 0; i &lt; 3; ++i) {
          std::vector&lt;A&gt; as;
          for (int j = 0; j &lt; 2; ++j)
              as.emplace_back(j);
          bs2.emplace_back(std::move(as), i); // Move 3
      }
  
      C c(std::move(bs1), std::move(bs2)); // Move 4
      c.display();
      return 0;
  }
  </code></pre>
  <p><strong>Some assumptions</strong>:</p>
  <ul>
  <li>I believe that there is no significant difference between &quot;Move 1&quot; and &quot;Move 2&quot;</li>
  <li>I believe that there is no significant difference between &quot;Move 3&quot; and &quot;Move 4&quot;</li>
  <li>To the best of my knowledge <code>std::forward</code> is not a good replacement for any of the <code>std::move</code> usages because there are no templates</li>
  </ul>
  <p><strong>The question</strong>:
  Are all of the <code>std::move</code> usages meaningful or are any of them unnecessary?</p>