Overloading
Overloading
Posted May 1, 2014 23:14 UTC (Thu) by dtlin (subscriber, #36537)In reply to: Overloading by jwakely
Parent article: Porting the Go compiler to Go
I don't usually complain about iostreams, but this one's easy.
cout << flags & 0xff; // (cout << flags) & 0xff cout << b ? yes : no; // (cout << b) ? yes : no
Posted May 2, 2014 9:57 UTC (Fri)
by jwakely (subscriber, #60262)
[Link]
int j = i * b ? 10 : 100;
Does this mean operator* is "non-intuitive and easy to get wrong" for multiplication of integers, and "so internally inconsistent and unintuitive that actually writing correct code in it requires you to keep a heroic number of things in your mind at the same time"?
Or does it just mean you should probably use parentheses for expressions that use more than just the familiar mathematical operators we learnt at school?
Overloading
