Found during pair programming (yes, I do it sometimes): class Foo { public: Foo(bool in); … }; … Foo f = new Foo(true); … Yikes. Didn’t expect that to get by the compiler. But it did. Without even a warning. The compiler was happy to turn “new Foo” into a boolean value and instantiate f, [...]
Entries from October 2007
Yet another way to shoot yourself in the foot with C++
October 12th, 2007 Comments Off
Tags: