Comment by account42
2 days ago
> Despite its name, NRVO is not actually an 'optimization' in the compiler. The optimizer plays no role in it, since the optimizer is fulfilling the requirements of the abstract machine. Instead, it is a set of conditions that allows the frontend to omit calls to copy constructors, etc. under specific circumstances.
That's semantics. The way the compiler is structured and in which component the transformation is implemented has no bearing on whether something is an optimization.
[flagged]