Changes between Version 6 and Version 7 of const
- Timestamp:
- May 13, 2010, 5:26:26 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
const
v6 v7 16 16 `foo *` may be implicitly converted to `const foo *`, but not the other way around. 17 17 18 `foo **` 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 could write through `const foo *p` as follows: `foo *q; const foo **pq = &q; *pq = p; *q = …;`). 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.