博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C++ templates chapter 9(Names in Templates)
阅读量:4917 次
发布时间:2019-06-11

本文共 3387 字,大约阅读时间需要 11 分钟。

I don't understand this chapter well.
Maybe I need to read it again.
 Name Taxonomy (part one)

Classification

Explanation and Notes

Identifier

A name that consists solely of an uninterrupted sequences of letters, underscores (_) and digits. It cannot start with a digit, and some identifiers are reserved for the implementation: You should not introduce them in your programs (as a rule of thumb, avoid leading underscores and double underscores). The concept of "letter" should be taken broadly and includes special universal character names (UCNs) that encode glyphs from nonalphabetical languages.

Operator-function-id

The keyword operator followed by the symbol for an operator?for example, operator new and operator [ ]. Many operators have alternative representations. For example, operator & can equivalently be written as operator bitand even when it denotes the unary address of operator.

Conversion-function-id

Used to denote user-defined implicit conversion operator梖or example operator int&, which could also be obfuscated as operator int bitand.

Template-id

The name of a template followed by template arguments enclosed in angle brackets; for example, List<T, int, 0>. (Strictly speaking, the C++ standard allows only simple identifiers for the template name of a template-id. However, this is probably an oversight and an operator-function-id should be allowed too; e.g. operator+<X<int> >.)

Unqualified-id

The generalization of an identifier. It can be any of the above (identifier, operator-function-id, conversion-function-id or template-id) or a "destructor name" (for example, notations like ~Data or ~List<T, T, N>).

Qualified-id

An unqualified-id that is qualified with the name of a class or namespace, or just with the global scope resolution operator. Note that such a name itself can be qualified. Examples are ::X, S::x, Array<T>::y, and ::N::A<T>::z.

Qualified name

This term is not defined in the standard, but we use it to refer to names that undergo so-called qualified lookup. Specifically, this is a qualified-id or an unqualified-id that is used after an explicit member access operator (. or ->). Examples are S::x, this->f, and p->A::m. However, just class_mem in a context that is implicitly equivalent to this->class_mem is not a qualified name: The member access must be explicit.

Unqualified name

An unqualified-id that is not a qualified name. This is not a standard term but corresponds to names that undergo what the standard calls unqualified lookup.

 
Name Taxonomy (part two)

Classification

Explanation and Notes

Name

Either a qualified or an unqualified name.

Dependent name

A name that depends in some way on a template parameter. Certainly any qualified or unqualified name that explicitly contains a template parameter is dependent. Furthermore, a qualified name that is qualified by a member access operator (. or ->) is dependent if the type of the expression on the left of the access operator depends on a template parameter. In particular, b in this->b is a dependent name when it appears in a template. Finally, the identifier ident in a call of the form ident(x, y, z) is a dependent name if and only if any of the argument expressions has a type that depends on a template parameter.

Nondependent name

A name that is not a dependent name by the above description.

转载于:https://www.cnblogs.com/zhtf2014/archive/2009/10/02/1577430.html

你可能感兴趣的文章
[Swift通天遁地]三、手势与图表-(6)创建包含三条折线的线性图表
查看>>
[Swift]LeetCode13. 罗马数字转整数 | Roman to Integer
查看>>
OpenGL学习笔记2017/8/29
查看>>
实验吧web加了料的报错注入
查看>>
字符窜转对象
查看>>
6、Linux 基础(二)
查看>>
Letter Combinations of a Phone Number
查看>>
C#动态操作DataTable(新增行、列、查询行、列等)
查看>>
Slim 微型框架的使用
查看>>
高程5.4 RegExp类型
查看>>
CMD复制文件夹
查看>>
尽力而为
查看>>
Java技术预备作业
查看>>
阿虎烧烤的新感悟-O2O你真的会玩吗?
查看>>
Oracle10g闪回恢复区详细解析(转载)
查看>>
手把手教你从零认识webpack4.0
查看>>
(译)加入敌人和战斗:如果使用cocos2d制作基于tiled地图的游戏:第三部分
查看>>
[小米OJ] 3. 大数相减
查看>>
课后作业2:编写一个文件加解密程序,通过命令行完成加解密工作
查看>>
js 值类型和引用类型
查看>>