C++ UFCS update

Era Scarecrow via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 21 18:32:31 PST 2016


On Sunday, 21 February 2016 at 22:32:23 UTC, Walter Bright wrote:
> I'm not thrilled about overloading | with a non-arithmetic 
> purpose. I hated iostreams' use of << from the beginning.

  Ditto, I've always hated it as well. I recall reading that the 
original iostream class was an example class (and badly 
designed), not only does the implementation look ugly to use, but 
it has no value in a logical/mathematical way unlike how those 
operators are intended to work natively (unlike say gmp or BigNum 
or something).

  At least overloading the + in Java was limited strictly to 
concatenation of strings.

  I can sort of see how the | (pipe) might be overloaded 
acceptably if you're working a lot with shell (script 
programmers) where you send the output of one program as the 
input of another, but that doesn't appear to offer any real 
advantage compared to what is already being used with UFCS.

  Best not to break what's not broke.


More information about the Digitalmars-d mailing list