Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Copy elision?

Definition 2.9 University Computer Science — Year 2 · Bab 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.

Baca dalam konteks →