I was wondering if there was a way to put this on one line?
if (auto r = getGlobalObjectByName(word)) r->doSomething; // This works fine
if (!auto r = getGlobalObjectByName(word)) r->doSomething; // Says "expected an expression"
if (auto r = getGlobalObjectByName(word) == false) r->doSomething; // Also doesn't work.
I also tried surrounding it with extra brackets, but that doesn't seem to work. I find this really convenient doing it on one line.