Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Copy elision?

Definition 2.9 University Computer Science — Year 2 · Capítulo 2 — Copying, Moving and Smart Pointers

Copy elision is the construction of an object directly in its final place, which removes a copy or move. Since C++17 it is guaranteed when an object is initialised from a prvalue of its type: T x = T(...), T x = f() with f returning a prvalue, and return T(...);. When a function returns a named local object, the compiler may also build it in the caller’s object (the named return value optimisation), but is not required to; if it does not, the return moves.

Leer en el capítulo →