C 11标准中“顶级cv-qualifiers”的定义在哪里?

the draft C++11 standard: N3337年,我发现几个参考顶级cv限定词,但没有定义.

解决方法

这个问题让我有机会学习新的东西,所以我在这里分享,我没有写下面的段落!

在C中,应用于类型的第一级的cv-qualifier称为toplevel cv-qualifier.例如,在:

T *const p;

顶级cv-qualifier是const,并且在:

T const *volatile q;

顶级cv-qualifier是不稳定的.另一方面:

T const volatile *q;

没有顶级cv限定词.在这种情况下,cv-qualifiers const和volatile出现在第二级.

函数的签名包括出现在该函数参数类型中的所有cv限定符,除了出现在参数类型顶层的限定符除外.

例如,在:

int f(char const *p);

const限定符不在参数声明的顶层,因此它是函数签名的一部分.

另一方面,在:

int f(char *const p);

const限定符处于顶级,因此它不是函数签名的一部分.
功能具有与以下相同的签名:

int f(char *p);

资料来源:Top-Level cv-Qualifiers in Function Parameters

我在标准中找不到定义,但是我在上面发布的内容在N3337§8.3.5-5中有明确规定

After producing the list of parameter types,any top-level
cv-qualifiers modifying a parameter type are deleted when forming the
function type.

编辑:
在撰写上述文章时,标准中的定义无法找到,但现在有一个as pointed out by Shafik

n4296摘录:

In this International Standard,the notation cv (or cv1,cv2,etc.),used in the description of types,represents an arbitrary set of cv-qualifiers,i.e.,one of {const},{volatile},{const,volatile},or the empty set. For a type cv T,the top-level cv-qualifiers of that type are those denoted by cv. [Example: The type corresponding to the type-id const int& has no top-level cv-qualifiers. The type corresponding to the typeid volatile int * const has the top-level cv-qualifier const. For a class type C,the type corresponding to the type-id void (C::* volatile)(int) const has the top-level cv-qualifier volatile. — end example ]

相关文章

本程序的编译和运行环境如下(如果有运行方面的问题欢迎在评...
水了一学期的院选修,万万没想到期末考试还有比较硬核的编程...
补充一下,先前文章末尾给出的下载链接的完整代码含有部分C&...
思路如标题所说采用模N取余法,难点是这个除法过程如何实现。...
本篇博客有更新!!!更新后效果图如下: 文章末尾的完整代码...
刚开始学习模块化程序设计时,估计大家都被形参和实参搞迷糊...