| ▲ | dataflow 2 hours ago | |
The point of (N)RVO is to directly construct the return value in-place at the calling frame. Which requires knowing what object will land there. In RVO there is no problem because you know what object is the one you need to put there. In NRVO there is a problem because you might have one of multiple objects being returned and you need to know which one to construct at the call site; it can't be all of them on top of each other. But you don't necessarily know at the time of construction whether that object will be the one that is actually returned. Doing so requires imperfect code analysis so the standard would need to define the complicated analyses to perform. | ||