Personal dialects and C++ overloading

Bob Stout Bob.Stout at p6.f506.n106.z1.fidonet.org
Thu Feb 1 13:34:21 AEST 1990


In an article of <31 Jan 90 07:52:10 GMT>, (Steve Watt) writes:

 >  The exact potential problem with overloading is that each operator does
 >not NECESSARILY give some clue as to what it does.  For example:  I'd love
 >to do something cruel and inhuman to the person who came up with 
 >       "This is a test" >> cout
 >
 >  Because to me, >> means shift right!  Clearly, someone else (I think his
 >initials are actually B.S.*! :) thinks of >> as 'put something to there'.
 >  But why not use -> for output and <- for input?  a * b (where a and b are
 >some appropriate class) could mean add a and b, a repetitions of b, or some
 >other thoroughly bizarre operation (such as removing string b from string 
 >a).

  When this topic came up in the FidoNet C++ conference, *this* particular  
B.S. noted that it will take an extraordinary amount of discipline on the part  
of programmers using operator overloading to keep C++ from becoming "the Forth  
of the '90's" 



More information about the Comp.lang.c mailing list