I am using C++98. To what extent can function calls be reordered? I am not using any global state, only state of objects local to the function.
My particular case is:
{
RaiiType T;
Object1.FunctionCall();
Object2.FunctionCall();
}
Where Object1 and Object2 are declared in the next scope up. Is the constructor for T
permitted to be reordered after either function call, assuming that it can be trivially proven (at least to a human) that there are no dependencies between the construction and the function calls?
In my particular case, the RAII object is used to time the execution of the function calls.