overloading operators for I/O

Walter Bright newshound at digitalmars.com
Wed Feb 14 18:35:29 PST 2007


Hasan Aljudy wrote:
> That's because you're a nerd, Walter <g>

Yup <g>.

> I learned C++ I/O long long before I learned bit manipulation and bit 
> shifting.
> 
> In fact, I was kinda surprised when I learned that C uses << as a bit 
> shifting operator.
> 
>> Now back to '<<' and '>>'. To me, they are arithmetic operators, and 
>> mean shift left and shift right. Shift is not an I/O operation. To say 
>> they are intuitive is not because they are, but because C++ users are 
>> simply accustomed to it.
> 
> Same goes for using them as bit shifting, to say it scream bit shifting 
> is not because it does, but because you are accustomed to it.

Every other "C like" language uses << for shifting.



More information about the Digitalmars-d mailing list