title: ranges-v3 flattern with move
body: <p>I am trying to do a flatten on  a container of container into one dimension, with views::join and views::move, but I have hard time to understand the difference between move first and then join VS join and then move. Try2 worked as expected, but can someone help me to understand what happening under the hood that so that  the Try1 ends up copying ? somewhere the move did not work. Thanks ! </p>
  
  <p>wandbox link to the code: <a href="https://wandbox.org/permlink/BeFI3wjBiUPbsMA2" rel="nofollow noreferrer">https://wandbox.org/permlink/BeFI3wjBiUPbsMA2</a></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  #include &lt;range/v3/all.hpp&gt;
  
  int main()
  {     
      auto words = std::vector&lt;std::vector&lt;std::string&gt;&gt;{
          {"Hello", "World"},
          {"ni","hao"}
      };
      // Try1
      auto result1 = words
          | ranges::views::move
          | ranges::views::join
          | ranges::to&lt;std::vector&lt;std::string&gt;&gt;();
  
      std::cout&lt;&lt;ranges::views::all(ranges::views::join(words))&lt;&lt;std::endl;
      //[Hello,World,ni,hao]
  
      // Try2   
      auto result2 = words
          | ranges::views::join
          | ranges::views::move
          | ranges::to&lt;std::vector&lt;std::string&gt;&gt;();
  
      std::cout&lt;&lt;ranges::views::all(ranges::views::join(words))&lt;&lt;std::endl;
      //[,,,]
  }
  </code></pre>