Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Rvalue reference?

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

Lees in het hoofdstuk →