jeudi 28 mai 2020

Differences between return value optimization and `std::move`?

What are the differences between return value optimization and std::move? Do they depend on same internal implementation?

I understand that there are many places where must use std::move.

std::move and RVO both could achieve copy elision.For example, T Func() {return T();} T t=Func();.I think i could not figure out which method the compiler really uses.

I am a novice in C++.I would be grateful for any hint on this question.

Aucun commentaire:

Enregistrer un commentaire