Why is RVO disallowed when returning a parameter?
Imagine no_rvo is defined in a different file than main so that when compiling main the compiler will only see the declaration X no_rvo(X x); and will have no idea whether the object of type X returned has any relation to the argument. From what it knows at that point, the implementation of no_rvo could … Read more