As said here in this link
A condition in an if or while expression can be either an expression or a declaration of a single variable (with initialization).
So, if you try this code, you will get an error again.
if((auto ret = GetSettings(InputField)))
{
if(ShouldWeDoThis())
{
do something with ret;
}
}
Rules for declaring variables in a select statement:
- can only have one variable declared per expression
- variable declaration must occur first in the expression and
- ( )