View Single Post
Old 06-29-2005, 08:53 PM   #10 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
Besides that, a destructor needs to be called for the temporary variable as well. The std::string has its own swap() method indeed. It is usually between 6 or 7 times as faster as the methods presented earlier.

Nevertheless, there is no "irony" involved in the kind of assignments presented earlier. Often the student needs to learn to develop algorithms at an early stage. Re-inventing the wheel is a common thing.
__________________
Valmont is offline   Reply With Quote