Identifiers
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:
- an overloaded operator name in function notation, such as operator+ or operator new;
- a user-defined conversion function name, such as operator bool;
- a user-defined literal operator name, such as operator "" _km;
- a template name followed by its argument list, such as MyTemplate<int>;
- the character ~ followed by a class name, such as ~MyClass;
- the character ~ followed by a decltype specifier, such as ~decltype(str).
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
Identifiers的更多相关文章
- 在真机调试 iOS 应用:理解 Certificates, Identifiers & Profiles
No matching provisioning profiles found. No matching code signing identity found. Your account alrea ...
- 理解Certificate、App Id、Identifiers 和 Provisioning Profile
做真机测试的时候,按照网上的流程,走通了,当时没有注意各种证书等的意思.现在做消息推送,需要各种证书.APP ID信息,为了更好的理解这个过程,所以整理了网上关于证书等的相关资料.方便自己和有需要的朋 ...
- sdut 2163:Identifiers(第二届山东省省赛原题,水题)
Identifiers Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 Identifier is an important c ...
- 关于Spatial referencing by geographical identifiers 标准
地理信息空间参考大体可以分为两类,ISO给出了分类:Spatial referencing by geographical identifiers(根据地理标识符的空间定位,ISO 19112)与Sp ...
- iOS真机调试——Certificates, Identifiers &Profiles 简介
Certificates, Identifiers &Profiles 简介 每次到这个页面,我都不知道这几个选项是干啥的,我相信有很多同学跟我一样,所以首先我们就来先介绍下Developer ...
- [2011山东省第二届ACM大学生程序设计竞赛]——Identifiers
Identifiers Time Limit: 1000MS Memory limit: 65536K 题目:http://acm.sdut.edu.cn/sdutoj/problem.php?act ...
- [转载]ACM(访问控制模型),Security Identifiers(SID),Security Descriptors(安全描述符),ACL(访问控制列表),Access Tokens(访问令牌)
对于<windows核心编程>中的只言片语无法驱散心中的疑惑.就让MSDN中的解释给我们一盏明灯吧.如果要很详细的介绍,还是到MSDN仔细的看吧,我只是大体用容易理解的语言描述一下. wi ...
- [2011山东ACM省赛] Identifiers(模拟)
Identifiers Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描写叙述 Identifier is an important ...
- iOS开发-Certificates、Identifiers和Profiles详解
如果是才进入公司进行开发的iOS程序猿来说人难免会对苹果的证书.配置文件,尤其有的需要重头开始的公司来说,最简单的来说真机调试是免不了和这些东西打交道的,有的时候赶时间做完了可能心里也犯嘀咕,本文根据 ...
随机推荐
- Problem A: 走迷宫问题
Problem A: 走迷宫问题Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 9 Solved: 3[Submit][Status][Web Board] ...
- BZOJ 1044: [HAOI2008]木棍分割(二分答案 + dp)
第一问可以二分答案,然后贪心来判断. 第二问dp, dp[i][j] = sigma(dp[k][j - 1]) (1 <= k <i, sum[i] - sum[k] <= ans ...
- servlet三种实现方式之三通过继承HttpServlet开发servlet
servlet有三种实现方式: 1.实现servlet接口 2.继承GenericServlet 3.通过继承HttpServlet开发servlet 第三种: import java.io.*; i ...
- python -- 计算数学题--用程序解决问题1
1.#一个四位数,各位数字互不相同,所有数字之和等于6,并且这个数是11的倍数,#则满足这种要求的四位数有多少个? 代码如下: # -*- coding: UTF-8 -*-import systyp ...
- SMTP 553
当邮件使用SMTP协议 身份认证时,如果出现 javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessf ...
- C#使用WinAPI 修改电源设置,临时禁止笔记本合上盖子时睡眠
原文 http://www.cnblogs.com/h46incon/archive/2013/09/03/3299138.html 在 阻止系统自动睡眠的小软件,附C#制作过程 ,弄了一个防止系统睡 ...
- [编程语言][java][java se]java泛型中? T K V E含义(学习)
? 表示不确定的java类型,类型是未知的. T 表示java类型. K V 分别代表java键值中的Key Value. E 代表Element,特性是枚举. 1.意思 jdk中的K,V, ...
- C++ Primer的课后规划问题的第八章
1.写通常需要一个参数(字符串的地址).字符串和打印功能. 只要.假设提供了第二个参数(int种类),而这个参数不0,的次数的函数打印串数量为该功能将被称为(意,字符串的打印次数不等于第二个參数的值. ...
- python 面试相关
python单例模式: Python真的需要单例模式吗?我指像其他编程语言中的单例模式. 答案是:不需要! 因为,Python有模块(module),最pythonic的单例典范.模块在在一个应用程 ...
- sql日期转换格式
Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM Select CONVERT(varchar(100), GETDATE( ...