C++ UFCS update

Era Scarecrow via Digitalmars-d digitalmars-d at puremagic.com
Mon Feb 22 23:46:08 PST 2016


On Tuesday, 23 February 2016 at 07:22:26 UTC, Ola Fosheim Grøstad 
wrote:
>> I have to ask: How will adding a new token help us or improve 
>> the language?
>
> How will it not help?

  How about let's rephrase this as a short example. Let's say we 
add @ for a symbol which by default just duplicates +. So:

  a @ b; //is a + b

  So:

  x[] @ y[] //is legal now too.

  foreach(i,a; x) {
    //I'll assume $ is also the same as multiply, just for fun
    //also no clue what this code would be for
      zz@=x[i at b]@y[i$(b at c)@z]$a;
//vs zz+=x[i+b]+y[i*(b+c)+z]*a;
  }


  If | effectively does the same as . (at least that's the 
impression I get, maybe I'm totally wrong), what benefit does it 
give other than confusing or obfuscating code?

  Before adding it in, I'd need a clean proof of concept of why 
it's a good idea to add.


More information about the Digitalmars-d mailing list