Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é 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.

Ler no capítulo →