4 ms·
N1570 6.7.9p11 says that the constraints and conversions for simple assignment apply to scalar initializers. 6.5.16.1p1 says that, for pointers, "the type poin
by _kst_ 7y ago
N1570 6.7.9p11 says that the constraints and conversions for simple assignment apply to scalar initializers.
6.5.16.1p1 says that, for pointers, "the type pointed to by the left has all the qualifiers of the type pointed to
by the right".
In this case, the right operand is a pointer to a const-qualified type and the left operand is a pointer to a non-const-qualified type.
(Without this restriction, you could silently discard const qualification just by assigning or initializing a pointer, which would largely defeat the purpose of const.)