C++ UFCS update

Ola Fosheim Grøstad via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 23 13:35:19 PST 2016


On Tuesday, 23 February 2016 at 20:54:25 UTC, Era Scarecrow wrote:
>  Considering it's just an #include forcing a replacement, it 
> hides a little of what it's doing. Honestly && and || look fine

No, they are keywords.

http://en.cppreference.com/w/cpp/keyword/and

> machine: + is add, - is sub, ~ is neg, etc etc. That's another 
> reason -> was used because the indirection could make a 
> noticeable difference in heavy code (especially if they were 
> several levels deep).

Huh? C is a minimalistic language, where even basic operations 
are just syntactical sugar. E.g. "a[2+3]" is just a short hand 
for "*(a+2+3)".

>  So you're annoyed that Walter uses ! which is used 1/500th the 
> time compared to << and >>, and by using ! he avoided the 
> annoying <> which causes lots of slowdowns during compiling 
> while doing templates.

No way "!" is less used than "<<"... And "<...>" does not cause 
noticable slow downs when compiling.

> One of the best reasons ! works is it's an unary operation, 
> compared to << >> < and >. He also reused ~ for appending 
> (previously neg) also used about 1/500th of the time,

Another horrible idea.

> but you aren't complaining about that (unless I just haven't 
> noticed since I'm not watching the forums closely).

Oh yes, I have. :-)




More information about the Digitalmars-d mailing list