On Thu, 24 Aug 2000 09:38:28 +0100, Hildo Biersma wrote:

>> I expect that we'll get more compile-time benefit from
>> 
>>     my HASH sub foo {
>>         ...
>>     }
>> 
>>     %bar = foo();
>
>Ah, the Return Value Optimization so loved in C++...
>
>For those who haven't seen it before, you can optimize this by passing
>in a reference to %bar to foo() and then use that in the function.

Just a remark: this is only safe if all other references to the hash
returned are abandoned. Otherwise you'd have an alias where you should
have gotten a copy.

-- 
        Bart.

Reply via email to