Overloading operators : const vs non-const return type : any difference of performance?

Viewed 2322

If we go to the wikipedia article about C++ operators, we have as an example :

Addition : a + b -> T T::operator +(const T& b) const;

So the operator return a non-const of type T. If we look at this guideline the author say that the return type should be a const to avoid the following syntax :

(a+b) = c

Now assume that this syntax doesn't bother me, and consider that a and b are large arrays. From a "pure" performance point of view, can the absence of the const keyword in the return type prevent optimizations from the compiler (g++ and intel icpc with -O3) ? And if the aswer is "yes", why ?

3 Answers
Related