Aqualification-decomposition of a typeTis a sequence ofcvi andPisuch thatT is“cv0P0cv1P1⋯cvn−1Pn−1cvnU” forn ≥ 0,whereeachcvi is a set of cv-qualifiers ([basic.type.qualifier]), andeachPi is“pointer to” ([dcl.ptr]),“pointer to member of classCi of type” ([dcl.mptr]),“array ofNi”, or“array of unknown bound of” ([dcl.array]).
IfPi designates an array,the cv-qualifierscvi+1 on the element type are also taken asthe cv-qualifierscvi of the array.
The type denoted by thetype-idconstint**has three qualification-decompositions,takingUas “int”,as “pointer toconstint”, andas “pointer to pointer toconstint”.
Two typesT1 andT2 aresimilar ifthey have qualification-decompositions with the samensuch that correspondingPi components are either the sameor one is “array ofNi” and the other is “array of unknown bound of”,and the types denoted byU are the same.
If a program could assign a pointer of typeT** to a pointer oftypeconstT** (that is, if line #1 below wereallowed), a program could inadvertently modify a const object(as it is done on line #2).
For example,int main(){constchar c='c';char* pc;constchar** pcc=&pc;// #1: not allowed*pcc=&c;*pc='C';// #2: modifies a const object}
A prvalue of type “pointer tocv1T” can beconverted to a prvalue of type “pointer tocv2T” if“cv2T” is more cv-qualified than “cv1T”.
A prvalue of type “pointer to member ofX of typecv1T” can be converted to a prvalue of type “pointer to memberofX of typecv2T” if “cv2T” is more cv-qualified than “cv1T”.