C++ Logo

std-discussion

Advanced search

[conv.qual]/1

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>).
<http://eel.is/c++draft/conv#qual-1.sentence-1>

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.
<http://eel.is/c++draft/conv#qual-1.sentence-2>

[ 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”.
<http://eel.is/c++draft/conv#qual-1.sentence-3>
 — *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
   <https://github.com/cplusplus/draft/commit/573152d081f7052f4ebe7678d58f94714f2b973b>
   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
   type-id
   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?
-- 
Belloc

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