Topic: String class (and others)


Author: sl@psycode.com.NOSPAM (Gili)
Date: 1998/06/08
Raw View
Hi,

 I was wondering why in many cases, String (and other such "standard"
classes) return 'void' instead of String& or whatever class they are?
Isn't this working against the entire idea of C?

 What do I mean? Well, when you go a=b=c, the compiler goes from b=c,
returns b and then a=b.. Now, idealy, I'd like to be able to do:

"String dummy("      hello");
 dummy.center().uppercase();"

 Assuming center() and uppercase() existed, I'd like to be able to
apply these two functions on the String at once. This comes in handy
in MANY places in my code (instead of doing the commands one at a
time.) Now.. Tell me.. *Why* isn't this done?

PS: Please reply by email as well as by newsgroup (to sl@psycode.com)

Gili


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]