[Patch] Fix libstdc++/12439

Paolo Carlini pcarlini@unitus.it
Wed Oct 1 16:35:00 GMT 2003


Nathan Myers wrote:

>> 	  else
>>-	    {
>>-	      *__s = __c;
>>-	      ++__s;
>>-	    }
>>+	    *__s++ = *__tmp;
>> 	}
>>       return __s;
>>     }
>>    
>>
>
>This last delta is suboptimal.  Post-increment is quite expensive on 
>many iterator types.  Code that takes general iterator types should
>always use pre-increment.  Any use of post-increment where we don't 
>know the iterator type should be considered a performance bug.
>  
>
Hi. Ok for this. I'd rather prefer not answering in public the other part...

Paolo.



More information about the Libstdc++ mailing list