Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why was the definition of a variable changed during the development of C++11?

n3035 says:

A variable is introduced by the declaration of an object. The variable's name denotes the object.

n3090 says:

A variable is introduced by the declaration of a reference other than a non-static data member or of an object. The variable's name denotes the reference or object.

I wonder what motivated this change. Does it have to do with rvalue references?

like image 604
fredoverflow Avatar asked May 25 '10 21:05

fredoverflow


1 Answers

The change was in response to CWG defect 633. The list of changes related to this can be found in n2993:

The goal of these changes is to expand the meaning of "variable" to encompass both named objects and references, and to apply the term consistently wherever feasible.

like image 135
James McNellis Avatar answered Nov 15 '22 18:11

James McNellis