[EMAIL PROTECTED] wrote: > Hi, > > Why g++ in Linux does not call copy constructor at return statement? > It's known as return value optimization. See: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.9 for more details. Basically though you can't rely upon any side effects of copy constructors (which in your case was the output), since compilers aren't required to make an instance and then copy it.
Alan _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus