home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16471 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.2 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!kronos.arc.nasa.gov!iscnvx!netcomsv!ulogic!hartman
  2. From: hartman@ulogic.UUCP (Richard M. Hartman)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Overload operator to concatenate Strings?
  5. Message-ID: <629@ulogic.UUCP>
  6. Date: 18 Nov 92 00:35:17 GMT
  7. References: <1992Nov13.111415.1@happy.colorado.edu>
  8. Organization: negligable
  9. Lines: 17
  10.  
  11. NIHCL uses the & operator, so at least there's precedent.  I prefer '+'
  12. myself.  To me a String is a String, and if it's underlying representation
  13. is "a vector of char" that is immaterial.  (I mean, isn't that what this
  14. Object stuff is supposed to be about? :)  Adding two Strings resulting
  15. in a single longer string seems perfectly reasonable to me.   '&' is
  16. intuitive if you consider the common english usage for it, but I have
  17. the C usage (bitwise and) too firmly embedded in my mind for me to like 
  18. it as the String concatenation operator.  Using '||' (or '&&') would
  19. be right out.  Since they have program flow uses that get lost if you
  20. overload them (if I understand the previous article correctly...)
  21.  
  22.         -Richard Hartman
  23.         hartman@ulogic.COM
  24.  
  25. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  26. "186,000 mi/sec.  Not just a good idea, it's the LAW!"
  27.  
  28.