Boost logo

Boost :

Subject: Re: [boost] Old style casts and Boost style guidelines
From: Edward Diener (eldiener_at_[hidden])
Date: 2008-09-15 20:31:33


Peter Dimov wrote:
> Jon Biggar:
>
>> I wanted to get rid of all old-style casts in my application, so I
>> turned on -Wold-style-cast in gcc and found a whole bunch of old-style
>> casts in boost headers.
>
> ...
>
>> ../../../boost/detail/sp_convertible.hpp:48: warning: use of old-style
>> cast
>
> (Y*)0 is so much nicer than static_cast< Y* >( 0 )... :-/

It is shorter, as are most uses of old-style casts as opposed to C++
new-style casts, but what makes it "nicer" ? To me a consistent syntax
which makes casts more easily recognizable is "nicer", so I always
consider new-style casts "nicer".


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