11-04-2017, 06:46 AM
Adding const/volatile is always safe and permitted by 11.3 because it applies to unqualified types only:
The non-compliant example at the bottom of 11.3 is very poorly chosen, because it has two levels of indirection, not one:
pointer to const pointer to int vs pointer to const pointer to const int
Your example is compliant IMHO, because it just adds const using one level of indirection.
I am curious about an official answer though.
Quote:the rule applies to the unqualified types. It does not prevent type qualifiers from being added...
The non-compliant example at the bottom of 11.3 is very poorly chosen, because it has two levels of indirection, not one:
pointer to const pointer to int vs pointer to const pointer to const int
Your example is compliant IMHO, because it just adds const using one level of indirection.
I am curious about an official answer though.
<t></t>