News for hackers. Stuff that matters.
Re:Obscure C++ Features by ben0x539 on Friday April 19, 2013 @02:31PM (#5578016)
The noteworthy bit is that declarations are valid in the conditional "expression" of if-statements and evaluate to the declared variable. It's imo not obvious that declarations are expressions sometimes.
Re:Obscure C++ Features by Sharlin on Friday April 19, 2013 @03:51PM (#5578389)
To be precise, declarations are never expressions - there are two forms of if and while statements in the grammar, one taking an expression and the other a declaration.