2 ms·
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 sem
by scott_s 14y ago
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.