Boost logo

Boost Users :

From: Steven Green (steven_at_[hidden])
Date: 2002-12-16 07:05:39


>
>
>>if (b)
>>
>> -- Darin
>>
>>
>
>Personally, I use if ( b.get() ), because on at least one compiler (Sun Workshop
>5), the simpler syntax caused a compiler error.
>
I prefer to use if(!!b) because then it will still work if you change
the pointer type later on in the project and only requires an
operator!() instead of the more dangerous operator bool (compiler can do
automatic type conversions behind your back leading to possible bugs if
you are not careful).

- Steven Green
http://www.greenius.ltd.uk


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net