That's a great idea Carl! You mean something like this:

int sum(int a, int b) {
  if( argc == 1 ) b = 1; //default for b if not supplied

  return a + b;
}

//...

auto f = ∑

//...

auto x = sum(y); //function pointer call, so fewer args permitted

oops! last line was supposed to be:

auto x = f(y); //function pointer call, so fewer args permitted

And for the record, 'argc' in the above is a name that has a similar status to 'this' and is equal to the number of arguments actually passed. Probably there's a better choice of name.


Reply via email to