Created on 2011-08-30.00:00:00 last changed 146 months ago
Rationale (October, 2012):
Although reinterpret_cast was permitted in address constant expressions in C++03, this restriction has been implemented in some compilers and has not proved to break significant amounts of code. CWG deemed that the complications of dealing with pointers whose tpes changed (pointer arithmetic and dereference could not be permitted on such pointers) outweighed the possible utility of relaxing the current restriction.
reinterpret_cast was forbidden in constant expressions to prevent type-punning operations at compile time. This may have been too strict, as there are uses for the operator that do not involve type punning. For example, a portable implementation of the addressof function could be written as a constexpr function if reinterpret_cast could be used in a constant expression.
History | |||
---|---|---|---|
Date | User | Action | Args |
2012-11-03 00:00:00 | admin | set | messages: + msg4174 |
2012-11-03 00:00:00 | admin | set | status: open -> nad |
2011-08-30 00:00:00 | admin | create |