Identifier

An identifier is an arbitrarily long sequence of digits, underscores, lowercase and uppercase Latin letters, and most Unicode characters (disallowed are control characters and characters in the basic source character set). A valid identifier must begin with a non-digit character (Latin letter, underscore, or Unicode non-digit character). Identifiers are case-sensitive (lowercase and uppercase letters are distinct), and every character is significant.

In expressions

An identifier that names a variable, a function, or an enumerator can be used as an expression. The expression consisting of just the identifier returns the entity named by the identifier. The value category of the expression is lvalue if the identifier names a function, a variable, or a data member, and prvalue otherwise (e.g. an enumerator is a prvalue expression).

Within the body of a non-static member function, each identifier that names a non-static member is implicitly transformed to a class member access expression this->member.

这里有两个注意点,一个是value category,有以下几种lvalue,prvalue(pure rvalue)和xvalue。函数,变量和成员变量的value category是lvalue,其他的value category是prvalue。关于详细的value category官网有详细的解释,感兴趣的可以看下。后面可能会单独列出。另外一个是在非静态成员函数内,非静态成员变量是被隐式地转换成

this->member访问的。

Unqualified identifiers

Besides suitably declared identifiers, the following can be used in expressions in the same role:

Together with identifiers they are known as unqualified id-expressions.

对于qualified identifiers编译器执行的是qualified name lookup,对于unqualified identifiers编译器执行的是unqualified name lookup。

关于overloaded operator是一些重载操作;user-defined conversion function则是一些用户自定义的转换函数--Enables implicit conversion or explicit conversion from a class type to another type.如

struct X {
//implicit conversion
operator int() const { return 7; }
};
执行以下语句是可以的
X x;
int n = static_cast<int>(x); // OK: sets n to 7
int m = x; // OK: sets m to 7

最新文章

  1. VTK初学一,a Mesh from vtkImageData—球冠
  2. XE6移动开发环境搭建之IOS篇(9):配置XE6的IOS SDK(有图有真相)
  3. linux rdate
  4. Windows 下配置使用MemCached(转载)
  5. sql2008还原问题
  6. Android源代码编译——编译
  7. JQuery的鼠标滚动事件
  8. UINavigationBar-使用总结
  9. GIS-开发例程、源代码、MapXtreme、Map (转)
  10. SQL Server 启用与禁止触发器
  11. Bullcow 牡牛和牝牛(bzoj 3398)
  12. 任务调度 -----&gt; quartz 不同时间间隔调度任务
  13. IO创建Socket通信中慎用BufferReader中的readLine()
  14. ubuntu1604使用之旅——安装samba
  15. Apache Commons Beanutils 二 (动态Bean - DynaBeans)
  16. Weblogic常见故障常:JDBC Connection Pools【转】
  17. 牛客网数据库SQL实战(11-15)
  18. 框架中如何根据fileupload工具包实现文件上传功能
  19. 2.两数相加(Add Two Numbers) C++
  20. TextView-- 测量文字宽度

热门文章

  1. C++ const 限定符
  2. 5.6.3.7 localeCompare() 方法
  3. JS数组方法总结
  4. 03-C语言编码规范和变量
  5. 帝国cms本地搬家到服务器文章路径问题?
  6. 手机SIM卡介绍 三类不同标准的SIM卡
  7. installscript类型 完成时实现推荐安装其他产品的功能
  8. 【水一发next_permutation】poj 1146——ID Codesm
  9. iOS9 白名单问题 -canOpenURL: failed for URL: &quot;xx&quot; - error:&quot;This app is not allowed to query for scheme xx&quot;
  10. js动画学习(四)