Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Rvalue reference?

Definition 2.7 University Computer Science — Year 2 · Capítulo 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.

Leer en el capítulo →