What rules to follow for a function to use NRV optimization
<p>What rules or tips should I follow to enable a function to use NRV (named return value) optimization in a function? I assimilated these tips from different places, but don't know if it my understanding is correct:</p>

<ol>
<li>the object to be returned should not have any name inside the function (then why is it called NAMED return value optimization!!)</li>
<li>return statement should have object surrounded by parenthesis</li>
<li>object to be returned should have explicit and inline copy constructor</li>
</ol>
