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程序猿来说人难免会对苹果的证书.配置文件,尤其有的需要重头开始的公司来说,最简单的来说真机调试是免不了和这些东西打交道的,有的时候赶时间做完了可能心里也犯嘀咕,本文根据 ...
随机推荐
- 关于playframework2.5
加入了很多新东西: 1.用akka streams 替换了大部分 iteratee-based async io,当然还有一些模块在用iteratees 2.java 的一些API 做了调整升级,以及 ...
- 指针和引用区别 C++
#include <iostream> using namespace std; int main(){ ; void cubeByPoint(int *);//指针传参声明 void c ...
- 操作 IoT 设备内嵌 SQLite
Win10 IoT C#开发 5 - 操作 IoT 设备内嵌 SQLite 数据库 CURD Windows 10 IoT Core 是微软针对物联网市场的一个重要产品,与以往的Windows版本 ...
- 从事web前端两年半后的迷茫
做了两年半的重构,突然有种迷茫的感觉,好像瓶颈了,不知道自己该怎么继续走下去,以前刚毕业的时候,总觉得自己有好多的东西要学在前端方面,所以有那个促使自己去学习的动力,每当没工作任务的时候,自己总是去主 ...
- C++中struct和class的总结
一.在语法上的一些区别 由于C++是从C发展而来,C++中的struct更多的是去做了兼容的C的部分.在语法层面他们有以下的区别: 1. struct中所有的成员是是public,也就是说你可以对一个 ...
- android 安全未来怎么走
- Phoenix——实现向HBase发送标准SQL语句
写在前面一: 本文总结基于HBase的SQL查询系统--Salesforce phoenix 写在前面二: 环境说明: 一.什么是Phoenix 摘自官网: Phoenix是一个提供hbase的sql ...
- XML和DTD的简单介绍和入门
XML(Extensible Markup Lanaguage),可扩展标记语言,是标准通用标记语言(Standard Generalized Markup Language, SGML)的一个子集, ...
- js设置奇偶行数样式
$(document).ready(function () { odd = { "background": "none" }; //奇数样式 even = { ...
- 本地存储sessionStorage 、 localStorage 、cookie整理
sessionStorage . localStorage .cookie 的区别 sessionStorage 和 localStorage 是HTML5 Web Storage API 提供的,可 ...