Changes between Version 10 and Version 11 of const
- Timestamp:
- Oct 30, 2013, 12:48:19 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
const
v10 v11 16 16 `foo *` may be implicitly converted to `const foo *`, but not the other way around. 17 17 18 `foo **` may be implicitly converted to `foo *const *` (as a special case of the above), but may ''not'' be converted to `const foo **` (otherwise, you could write through `const foo *p` as follows: `foo *q; const foo **pq = &q; *pq = p; *q= …;`).18 `foo **` may be implicitly converted to `foo *const *` (as a special case of the above), but may ''not'' be converted to `const foo **` (otherwise, you would not be protected from writing to `const foo f`, as follows: `foo *p; const foo **pp = &p; *pp = &f; *p = …;`). 19 19 20 20 However, it is safe to convert `foo **` to `const foo *const *`. C++ lets you do this implicitly (conv.qual 4 in the standard); for no particular reason, C does not.