The Wayback Machine - https://web.archive.org/web/20130629053409/http://zh.cppreference.com:80/w/cpp/language/cv

cv (<div class="t-tr-text">const的波动<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">const-volatility</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div>) specifiers

来自cppreference.com

 
 
C + +语言
大会的主题
Original:
General topics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
流量控制
Original:
Flow control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
条件执行语句
Original:
Conditional execution statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
迭代语句
Original:
Iteration statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
跳转语句
Original:
Jump statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
功能
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
函数声明
lambda函数的声明
函数模板
的历史。内嵌说明
异常规范 (过时了)
noexcept说明 (C++11)
例外
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
命名空间
Original:
Namespaces
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
类型
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
decltype specifier (C++11)
规范
Original:
Specifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
CV符
存储时间说明符
constexpr说明 (C++11)
汽车符 (C++11)
alignas说明 (C++11)
初始化
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
布尔文字
nullptr (C++11)
用户定义的 (C++11)
表达式
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
另一种表示形式
实用工具
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
类型
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef declaration
声明类型别名 (C++11)
属性 (C++11)
施放
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
隐式转换
const_cast conversion
static_cast conversion
dynamic_cast conversion
reinterpret_cast conversion
C-风格和功能转换
内存分配
Original:
Memory allocation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
类特定的功能特性
Original:
Class-specific function properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
虚函数
覆盖说明 (C++11)
最后说明 (C++11)
明确的 (C++11)
静态的
特殊的成员函数
Original:
Special member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
模板
Original:
Templates
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
类模板
函数模板
模板特化
参数包 (C++11)
杂项
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
内联汇编
 
  • const - 定义的类型是“不变”的
    Original:
    const - defines that the type is constant.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • volatile - 定义的类型是“挥发性”的
    Original:
    volatile - defines that the type is volatile.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • mutable - 定义一个类的成员不影响外部可见状态之类的。 mutable成员可以��行修改,在“不变”是“常量性”本质上是忽略的特定成员的类,.
    Original:
    mutable - defines that a member of a class does not affect the externally visible state of the class. mutable members can be modified in constant classes, that is constness is essentially ignored for the particular member.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

[编辑] 解释

注: cv修饰符</ B>和<b> CV规范</ B>以上(列表)是不一样的thing.
的cv修饰符是一个类型的属性,而CV规范的语言功能定义cv修饰符
Original:
Note: <b>cv-qualifiers</b> and <b>cv-specifiers</b> (list above) are not the same thing.
The cv-qualifiers are properties of a type whereas cv-specifiers are language feature to define cv-qualifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
</div>
cv修饰符定义的类型的两个基本属性:“常量性”和“波动”。 CV-qualifer可以是下列之一:'const volatile''const''volatile''none'const定义一个类型是“不变”,volatile定义的类型是“挥发性”。非恒定性和非易失性的类型并没有额外的限制,而常数和挥发性意味着以下内容:
Original:
Cv-qualifiers define two basic properties of a type: constness and volatility. A cv-qualifer can be one of the following: 'const volatile', 'const', 'volatile' or 'none'. const defines that a type is constant, volatile defines that the type is volatile. Non-constant and non-volatile type has no additional restrictions, whereas constant and volatile imply the following:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • 不变 - 对象将不会被修改。尝试这样做的结果,不确定的行为。在大多数的编译器,它是编译时错误.
    Original:
    constant - the object shall not be modified. Attempt to do so results in undefined behavior. On most compilers it is compile-time error.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 挥发性 - 对象可以进行修改,通过编译器无法检测,因此一些编译器的优化,必须禁用.
    Original:
    volatile - the object can be modified by means not detectable by the compiler and thus some compiler optimizations must be disabled.
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
cv修饰符是偏序的顺序的限制越来越多。的类型,可以说是'多“或”少“CV合格的然后
Original:
There is partial ordering of cv-qualifiers by the order of increasing restrictions. The type can be said more or less cv-qualified then:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • “不合格”const
    Original:
    unqualified < const
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • “不合格”volatile
    Original:
    unqualified < volatile
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • “不合格”const volatile
    Original:
    unqualified < const volatile
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • const < const volatile
  • volatile < const volatile
任何cv修饰符的类型定义的一部分,因此类型,不同品种的资格都有不同的类型。因此,铸件所需要的匹配类型时,指定变量,函数调用等铸造“更多合格的简历”型是自动完成的<div class="t-tr-text"> 隐式转换
Original:
implicit conversions
The text has been machine-translated via [http://translate.google.com Google Translate].
You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.
。特别是,下面的转换是允许的
Original:
Any cv-qualifiers are part of the type definition, hence types with different cv-qualifications are always different types. Therefore casting is needed to match types when assigning variables, calling functions, etc. Only casting to more cv-qualified type is done automatically as part of
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
  • “不合格”类型可以转换const
    Original:
    unqualified type can be converted to const
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • “不合格”类型可以转换volatile
    Original:
    unqualified type can be converted to volatile
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • “不合格”类型可以转换const volatile
    Original:
    unqualified type can be converted to const volatile
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • const类型可以转换const volatile
    Original:
    const type can be converted to const volatile
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • volatile类型可以转换const volatile
    Original:
    volatile type can be converted to const volatile
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
要转换到“少品种合格的”类型,const_cast必须被使用
Original:
To convert to a less cv-qualified type, const_cast must be used.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[编辑] 关键字

const, volatile, mutable

[编辑] 为例