Boost logo

Boost :

From: Daniel James (daniel_at_[hidden])
Date: 2004-09-20 10:50:28


Richard Hadsell wrote:
> For clarity -- to tell the reader that you intended to modify the
> const-ness.

If I see const_cast, I usually expect it to cast away const-ness, not
add it. In my opinion, using a cast to add const is really a pretty
unusual thing to do so 'as_const' might be the clearest way of showing
your intent. Of course, it requires the reader to know what it means.

Daniel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk