I'm on the reviewers side here.

To be honest I never liked this DIP and maybe I'll sound dumb but I think this is a case where this could bring more problem than anything.

The way I see this would be more like a syntax sugar to create temporary variable for ref parameters and that's it.

But what I fail to see is why can't the programmer solve this themselves instead of relying on a new feature that would cause more harm?

With overload some could do:

void f(int i){
    f(i);
}

void f(ref int i){
    ++i;
    writeln(i);
}

void main(){
    int i = 0;
    f(10);
    f(i);
}

prints:
11
1

The "f" function will work with ref or literal (rvalues).

But this will be controlled by the programmer the way they want it.

Donald.
              • ... 12345swordy via Digitalmars-d-announce
              • ... Andrei Alexandrescu via Digitalmars-d-announce
              • ... Olivier FAURE via Digitalmars-d-announce
              • ... Nicholas Wilson via Digitalmars-d-announce
              • ... Manu via Digitalmars-d-announce
              • ... Steven Schveighoffer via Digitalmars-d-announce
              • ... Manu via Digitalmars-d-announce
              • ... Andrei Alexandrescu via Digitalmars-d-announce
          • Re: D... Manu via Digitalmars-d-announce
    • Re: DIP 1016--ref... Olivier FAURE via Digitalmars-d-announce
  • Re: DIP 1016--ref T ac... Don via Digitalmars-d-announce
  • Re: DIP 1016--ref T ac... bitwise via Digitalmars-d-announce

Reply via email to