为什么在C ++ 11的开发过程中变量的定义改变了? [英] Why was the definition of a variable changed during the development of C++11?
问题描述
n3035说:
一个变量是由对象的声明引入的。变量的名称表示对象。
A variable is introduced by the declaration of an object. The variable's name denotes the object.
n3090说:
一个变量由除非静态数据成员或对象的引用的声明引入。
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?
推荐答案
更改是响应 CWG缺陷633 。与此相关的更改列表可以在 n2993 中找到。 :
The change was in response to CWG defect 633. The list of changes related to this can be found in n2993:
这些更改的目的是将variable的含义扩展为包含命名对象和引用,始终如一。
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.
这篇关于为什么在C ++ 11的开发过程中变量的定义改变了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!