News for hackers. Stuff that matters.
Re:Is C/C++ worth it? by scott_s on Monday July 23, 2012 @09:44PM (#4283903)
Sorta, yes. It can evaluate one of the operator<<'s before doing the timer. The following:

  cout << "smarter sum " << N/(1000.0*time.split()) << endl;
Is semantically equivalent to:

  operator<<(endl, 
             operator<<(N/1000.0*time.split(),
                        operator<<(cout, "smarter sum ")
                        )
             );
The code with the timer in it can be called after the first call to operator<<; all parameters to functions have to be evaluated before the function is called, but there's no order the parameters themselves have to be evaluated in.

There are no comments on this comment yet.