Conditional Stack Variables
<p>Given the following function, will each of the local variables be declared on the stack?</p>

<pre><code>std::string reallyCoolFunction(unsigned int a)
{
   if( a &lt; 20 ) 
   {
     std::string result1 = "This function is really cool";
     return result1;
   }

   if( a &gt;=20 &amp;&amp; a &lt;= 40 )
   {
     std::string result2 = "This function is kind of cool";
     return result2;
   }

   if( a &gt; 40 )
   {
     std::string result3 = "This function is moderately cool";
     return result3;
   }

 std::string result4 = "This function really isn't that cool"; 
 return result4; // remove warning

}
</code></pre>

<p>In this situation, only one <code>std::string</code> is actually required, do all 4 get allocated on the stack, or does only 1 get allocated?</p>
