Equivalent code generated in return value optimization in c++
<p>I am not able to understand how is compiler able to optimize it under the covers. i.e, what is the equivalent code it generates?
There is an example of mentioned in <a href="http://en.wikipedia.org/wiki/Return_value_optimization" rel="nofollow">http://en.wikipedia.org/wiki/Return_value_optimization</a> which shows this code before optimization:</p>

<pre><code>struct Data { char bytes[16]; };

Data * f(Data * __hiddenAddress)
{
    Data result = {};
    // copy result into hidden object
    *__hiddenAddress = result;
    return __hiddenAddress;
}

int main()
{
    Data __hidden; // create hidden object
    Data d = *f(&amp;__hidden); // copy the result into d
}
</code></pre>

<p>It does not say the equivalent code ofter optimization</p>
