Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Rvalue reference?

Definition 2.7 University Computer Science — Year 2 · Bab 2 — Copying, Moving and Smart Pointers

An rvalue reference T && is a reference that binds only to rvalues. When a function is overloaded on const T & and T &&, a call with an lvalue picks the first and a call with an rvalue picks the second. std::move(a) does not move anything: it is a cast of the lvalue a to an xvalue, which tells the overload resolution that a may be emptied.

Baca dalam konteks →