|
Boost Users : |
From: David Abrahams (dave_at_[hidden])
Date: 2005-11-10 13:56:57
David Abrahams <dave_at_[hidden]> writes:
>> But a close substiture might be to convert the variable to
>> an integer, throw an exception if its not equal to 0 or 1
>
> No!! If you convert a bool to an integer and get something other than
> 0 or 1 then there's a bug in the program (or in the compiler). An
> assertion is appropriate.
But that said, I wouldn't try to assert that any more than I'd try to
validate that every pointer passed points at a valid object of the
pointee type.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
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