title: range v3 flattening a sequence
body: <p>So I recently watched this talk on c++:
  <a href="https://www.youtube.com/watch?v=mFUXNMfaciE" rel="noreferrer">https://www.youtube.com/watch?v=mFUXNMfaciE</a></p>
  
  <p>And I was very interested on trying it out. So after some toy program I am stuck on how to properly flatten a vector of vectors into a vector. According to the documentation here: <a href="https://ericniebler.github.io/range-v3/" rel="noreferrer">https://ericniebler.github.io/range-v3/</a> This is possible using <code>ranges::view::for_each</code>. However I just can't seem to get it to work. Here is some minimal code.</p>
  
  <pre><code>#include &lt;range/v3/all.hpp&gt;
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  int main()
  {
      auto nums = std::vector&lt;std::vector&lt;int&gt;&gt;{
          {0, 1, 2, 3},
          {5, 6, 7, 8},
          {10, 20},
          {30},
          {55}
      };
  
      auto filtered = nums
          | ranges::view::for_each([](std::vector&lt;int&gt; num) { return ranges::yield_from(num); })
          | ranges::view::remove_if([](int i) { return i % 2 == 1; })
          | ranges::view::transform([](int i) { return std::to_string(i); });
  
      for (const auto i : filtered)
      {
          std::cout &lt;&lt; i &lt;&lt; std::endl;
      }
  }
  </code></pre>