On 11/13/05 10:01 AM, "David Abrahams"
Daryle Walker
writes: Reading from an uninitialized variable, like what could happen in the original case during encoding, is not a problem any library can fix. The programmer just has to be non-sloppy.
I buy Robert's argument that, in the case of bool, the assertion will often help him diagnose the problem and help his users when they complain that the library isn't working because they forgot to initialize something. [TRUNCATE]
Since Robert's test involves undefined behavior, it's not portable. The assert may work on his system but may crash & burn on a different environment. The assert didn't help the second user at all. And what happens if the uninitialized variable just happens to match a valid state? -- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com