This is a follow-up on this question. The code in the OP question there looked quite reasonable and unambiguous to me. Why does not C++ allow using former parameters to defi
For one thing, this would require that a is evaluated before b, but C++ (like C) does not define the order of evaluation for function parameters.
a
b
You can still get the effect you want by adding an overload:
int foo(int a, int b) { /* do something */ } int foo(int a) { return foo(a, a); }