Boost logo

Boost :

Subject: Re: [boost] Old style casts and Boost style guidelines
From: Gennaro Prota (gennaro.prota_at_[hidden])
Date: 2008-09-14 07:40:56

Jon Biggar wrote:
> Peter Dimov wrote:
>>> 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 )... :-/
> True, but most of the stuff in boost headers is write-once.

... rewrite always, yes :-) Speaking in general --not about the specific
usages spotted here by gcc, which I haven't examined-- there are some
cases where C-style casts can't do any harm, and some where they have
been used because of compiler deficiencies (at least one of the latter
is in bitset_test.hpp, though it's adequately commented). For the rest,
I think you're seeing the hair and not the beam, so to speak.


Boost list run by bdawes at, gregod at, cpdaniel at, john at