title: Returning STL lists as argument
body: <p>I have a function that reads lines from a log file, converts these lines to a certain class and returns a STL list of instances of this class.</p>
  
  <p>How should I declare this function so that the whole list is NOT copied when attributing it to the caller?</p>
  
  <p>Without loss of generality, assume:</p>
  
  <pre><code>list&lt;Request&gt; requests = log_manipulator.getAsRequestList();
  </code></pre>
  
  <p>How should I declare <code>getAsRequestList()</code>? Should I return a reference to a list or just return a list?</p>
  
  <p>This is a serious issue because in this particular assignment the lists will contain circa 1.5M elements, and thus a mistake like that can screw up memory usage.</p>