On 10/21/2014 01:15 PM, bearophile wrote:
Ali Çehreli:

- References to any local data because 'ref' is only for parameters
and return types.

    int a;
    int b;
    int* r = (condition ? &a : &b);    // r must be a pointer
    *r = 42;

Regarding this example, this works:

void main() {
     int a, b;
     bool condition;
     (condition ? a : b) = 42;
}

Bye,
bearophile

Yes but that doesn't scale when we need to use it again:

  (condition ? a : b) = 42;
  foo(condition ? a : b);
  // ...

Ali

Reply via email to