List and list elements, where are stored?
<p>Given this piece of code:</p>

<pre><code>#include &lt;list&gt;
(void) someFunction(void) {
    list &lt;int&gt; l;
    l.push_back(1);
}
</code></pre>

<ul>
<li>Where are the elements of the list stored? Stack? Heap?</li>
<li>How can I do to empirically check that values are in stack or heap?</li>
<li>This function can returns the list? <strong>Edited</strong> If I declare function as list, can function returns list with out problems? </li>
</ul>

<p>Sample (returning list):</p>

<pre><code>#include &lt;list&gt;
list&lt;int&gt; someFunction(void) {
    list &lt;int&gt; l;
    l.push_back(1);
}

...
l2 = someFunction();
l2.push_back(2);
</code></pre>
