
20 Sep
2004
20 Sep
'04
3:46 p.m.
Richard Hadsell <hadsell@blueskystudios.com> writes:
Jonathan Turkanis wrote:
When I was writing it I initially typed 'const_cast', but then thought to myself: why use my big guns if I don't have to? ;-)
For clarity -- to tell the reader that you intended to modify the const-ness.
static_cast is a bigger gun than const_cast. At least const_cast cant violate data layout, and unless there is actually a constant object, won't result in undefined behavior. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com