
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Patrick Horgan Sent: Tuesday, November 17, 2009 7:59 PM To: boost@lists.boost.org Subject: Re: [boost] [new Warnings policy] MS C4180 on the Maintenance Guidelines
I've tried to distill the many helpful comments on this as follows: ||C4800|| int' : forcing value to bool 'true' or 'false'|| Use a bool valued expression. Write out expressions, for example: "value >= 0" or "ptr != 0" (Boost prefers clarity to curtness). Take care if using templates that constants are of the right type, for example you may need "static_cast<T>(1)". Or use static_cast<bool>(expression). Or suppress. ||# pragma warning(disable: 4800) // int' : forcing value to bool 'true' or 'false' Hope this is better. I note that this will mean quite a lot of work for some people as "if (ptr) ..." is such a common (and IMO dreadful) idiom. So I've left the getout clause "suppress" as a last resort. But this might encourage people to write new code in a nicer way. Paul --- Paul A. Bristow Prizet Farmhouse Kendal, UK LA8 8AB +44 1539 561830, mobile +44 7714330204 pbristow@hetp.u-net.com