#include class Foo { public: Foo(int i) { cout << "foo-ctor: " << i << endl; _i = i; } ~Foo() { cout << "foo-dtor: " << _i << endl; } int operator==(Foo & other){ return 0; } private: int _i; }; void f() { Foo f1=7; // '3' will or will not be turned into a temporary Foo object //bool b = ( 1 && f1==3 ); // temp object c'tor + d'tor bool b = ( 0 && f1==3 ); // temp object d'tor only! }