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
if (CThing* pThing = GetThing())
It is bad style, because inside the if you are not providing a boolean expression. You are providing a CThing*.
if
CThing*
CThing* pThing = GetThing(); if (pThing != NULL)
This is good style.