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

Julien Patrick Claassen julien at c-lab.de
Tue Aug 14 19:01:05 UTC 2001


Hello!
  You maybe just write your function as follows:
int DoSomething(int& i, int const& parameter)
{
  ...
  return i;
}

  So you could decide to either use the return value, i, or using i by
reference. The vaiable i will be cahnged in anyway and you can also return
it. I think wouldn't cause a conflict.
  Kindest regards
       Julien

Julien Patrick Claassen
jclaassen at gmx.de
julien at c-lab.de
http://www.geocities.com/jjs_home

SBS C-LAB
Fuerstenallee 11
33102 Paderborn

Phone: (+49) 5251 60 6060
Fax: (+49) 5251 60 6065

www.c-lab.de






More information about the tuxCPProgramming mailing list