actually not const from definition. But in the sample, I can not see such
code. Could you show me please?
"George" <George@discussions.microsoft.com> wrote in message
news:24241F1E-6887-4D79-A84D-26FED50EC856@microsoft.com
back even without const_cast, staying fully within C++ type system.
This means that the optimizer is not, after all, allowed to cache
the "const" value in this situation, which in turn means that
const_cast doesn't
How will compiler make use of the cached value in the future?
It won't. Which part of "is not allowed to cache" do you find unclear?
BTW: the following sample is not valid, since in the sample, no value
is changed through pointer p and function f, right?
Looks perfectly valid to me. I don't understand your concerns. Where
exactly do you believe the sample violates any rules of the language?
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925