title: Return vector as auto from function
body: <p>Is it possible to return std::vector as auto?
  For example:</p>
  
  <pre><code>auto retVec() {
    std::vector&lt;int&gt; vec_l;
  
    l.push_back(1);
    l.push_back(2);
  
    return vec_l;
  }
  ...
  auto ret_vec = retVec();
  for (auto&amp; it : ret_vec) {
  }
  </code></pre>
  
  <p>when I write something like this I get an error:</p>
  
  <ol>
  <li>error: use of <code>auto retVec()</code> before deduction of <code>auto</code> --->
      <code>auto ret_vec = retVec(**)**;</code></li>
  <li>error: unable to deduce <code>auto&amp;&amp;</code> from <code>ret_vec</code> ---> <code>for (auto it :
  **ret_vec**) {</code></li>
  </ol>
  
  <p>How do I actually write this?</p>
  
  <p><strong>UPDATE</strong>: 
  I'm sorry. I use this retVec as method in class and it doesn't work. When I use it as function in class - everything work fine. My mistake in formulating the question.</p>