. . . like in Algol68 or Smalltalk? The problem that this would solve is initialising a const variable for which the value is determined in an if-then-else statement.
Yes, I know, C++ is not defined like that. But what stands in the way? Would redefining the if-expression as an if statement break backward compatibility? Or would it be prohibitively difficult to disambiguate the required language documentation changes?
Example:
auto const x = if (some condition)
{
expression 1;
expression 2;
expression 3;
}
else
{
expression 4;
}
In this case I cannot do
auto const x = (some condition) ? expression1 : expression2;