Why returning FVector by copy?

Thanks for your answer.

In the wikipedia page you linked, it is said there are circumstances where RVO can not happen : Copy elision - Wikipedia

Apparently, USceneComponent::GetComponentLocation looks like to be such a case?

Are there so much benefits (performance? memory?) of returning copies of FVector and relying on RVO, instead of returning const references? (BTW, can RVO happen with const references?)

One caveat I can see is the lack of the semantic. With a const reference, you know for sure you don’t have a copy, whereas using the RVO, you have at least to be aware of the compiler optimization :slight_smile: