In C++ you can initialize a variable in an if statement, like so:
if (CThing* pThing = GetThing()) { }
Why would one consider this bad or g
This shoulddoesn't work in C++ sinceeven though it supports short circuiting evaluation. MaybeDon't try the following:
if ((CThing* pThing = GetThing()) && (pThing->IsReallySomeThing())) { }
err.. see Wesley Tarle's answer