C++ Logo


Advanced search


From: J.A. Belloc <jabelloc_at_[hidden]>
Date: Sat, 4 May 2019 18:53:08 -0300
[conv.qual]/1 <http://eel.is/c++draft/conv#qual-1>:

A *cv-decomposition* <http://eel.is/c++draft/conv#def:cv-decomposition> of
a type T is a sequence of cvi and Pi such that T is“cv0 P0 cv1 P1 ⋯ cvn−1 Pn
−1 cvn U” for n≥0,where each cvi is a set of cv-qualifiers (
[basic.type.qualifier] <http://eel.is/c++draft/basic.type.qualifier>), and
each Pi is “pointer to” ([dcl.ptr] <http://eel.is/c++draft/dcl.ptr>),
“pointer to member of class Ci of type” ([dcl.mptr]
<http://eel.is/c++draft/dcl.mptr>), “array of Ni”, or “array of unknown
bound of” ([dcl.array] <http://eel.is/c++draft/dcl.array>).

If Pi designates an array, the cv-qualifiers cvi+1 on the element type are
also taken as the cv-qualifiers cvi of the array.

[ Example <http://eel.is/c++draft/conv#qual-1.example-1>
The type denoted by the *type-id
<http://eel.is/c++draft/dcl.name#nt:type-id>* const int ** has two
cv-decompositions, taking U as “int” and as “pointer to const int”.
 — *end example*

The n-tuple of cv-qualifiers after the first one in the longest
cv-decomposition of T, that is, cv1,cv2,…,cvn, is called the *cv-qualification
signature* <http://eel.is/c++draft/conv#def:cv-qualification_signature> of T
. <http://eel.is/c++draft/conv#qual-1.sentence-4>

   1. This commit
   changed the cv-decomposition above from n > 0 to n >= 0. As far as I 'm
   concerned the n > 0 was correct.

   2. The paragraph above says the following: "The type denoted by the
   const int ** has two cv-decompositions taking U as "int" and as
   "pointer to const int".

   To the best of my knowledge I would say that the the type-id const int **
   has the following cv decomposition:

   cv0 = {} P0 = {pointer to}
   cv1 = {} P1 = {pointer to}
   cv2 = {const} U{ int}

What am I missing?

Received on 2019-05-04 16:54:59