Adding moving to basic_string

Paolo Carlini pcarlini@suse.de
Tue May 17 11:51:00 GMT 2005


Jonathan Wakely wrote:

>>Statements like "string s = a + b + c + d;", secondly things like"Return 
>>s" involves copying s, and then immediatly destroying it.
>>    
>>
>Doesn't the first case involve several temporary copies even with
>our ref-counted impl?
>  
>
Definitely. There is also something about that in the mentioned papers.
But, assignments are cheap in the reference-counted case. All in all,
optimizins such kind of constructs seems more important when
reference-counting is not available.

Paolo.



More information about the Libstdc++ mailing list