0

Can someone explain whats going on here? What kind of mathematical logic is being used in here?

(4.4/4) A conversion can add cv-qualifiers at levels other than the first in multi-level pointers, subject to the following rules:51) Two pointer types T1 and T2 are similar if there exists a type T and integer n > 0 such that: T 1 is cv 1 , 0 pointer to cv 1 , 1 pointer to . . . cv 1 ,n − 1 pointer to cv 1 ,n T and T 2 is cv 2 , 0 pointer to cv 2 , 1 pointer to . . . cv 2 ,n − 1 pointer to cv 2 ,n T where each cv i, j is const, volatile, const volatile, or nothing. The n-tuple of cv-qualifiers after the first in a pointer type, e.g., cv 1 , 1 , cv 1 , 2 , . . . , cv 1 ,n in the pointer type T1, is called the cv-qualification signature of the pointer type. An expression of type T 1 can be converted to type T 2 if and only if the following conditions are satisfied: — the pointer types are similar. — for every j > 0, if const is in cv 1 , j then const is in cv 2 , j , and similarly for volatile. — if the cv 1 , j and cv 2 , j are different, then const is in every cv 2 ,k for 0 < k < j.

user1086635
  • 1,536
  • 2
  • 15
  • 21
  • Illustration for your question in this (more concrete) question: [Why is the conversion from char*** to char*const** invalid?](http://stackoverflow.com/questions/40200807/why-is-the-conversion-from-char-to-charconst-invalid) – Andrianov Andrey Oct 25 '16 at 06:29

1 Answers1

0

I wouldn't really call it mathematical logic. This is (IMO) a pretty good example of type theory and type inferencing. For a general overview, wikipedia is your friend.

pg1989
  • 1,010
  • 6
  • 13