There will almost certainly be no difference. The compiler is allowed to do everything that he likes for your code, while the program behaves as if, if you wrote it. Therefore, any good compiler will get rid of senseless initializations.
However, it is possible that the situation cannot lead to this initialization disappearing. If, for example, the operator* overload used for GetValue() * GetOtherValue() returns a class type result using a const reference, the constructor of this class type may have some side effects. If so, the compiler cannot get rid of the initialization, since it changes the observed behavior of the program.
But why is this not the case if operator* returned by value? Then it will be a candidate for copying elitia, and the compiler can get rid of the construct regardless of whether it had side effects or not.
Joseph mansfield
source share