Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Value category, lvalue, rvalue » ?

Aussi appelé : value category · lvalue · rvalue

Definition 2.6 University Computer Science — Year 2 · Chapitre 2 — Copying, Moving and Smart Pointers

Every expression has a value category. An lvalue names an object that outlives the expression: a variable a, *p, v[i]. A prvalue computes a value that no name holds yet: 42, x + y, a call f() returning by value, Buffer("Quay"). An xvalue names an object whose resources may be taken, such as std::move(a). Prvalues and xvalues together are the rvalues.

Lire dans le chapitre →