[LC++]Using the "return value optimization"

Andy Zivkovic andy at zivkotech.net.au
Mon Aug 13 21:52:09 UTC 2001


What about:

int doSomething(int const& parameter);
void doSomething(int& i, int const& parameter) { i =
doSomething(parameter); };

or do void functions give some performance gain I'm not aware of?

Andy

> What I would really like it to do, is for return value
> optimization to take the following code:
>
>   int a=doSomething(parameter);
>
> and convert it into:
>
>   int a;
>   doSomething(a, parameter);




More information about the tuxCPProgramming mailing list