On 08/05/2016 04:07 PM, Richard Biener wrote:
On August 5, 2016 8:15:54 PM GMT+02:00, Oleg Endo <oleg.e...@t-online.de> wrote:
On Fri, 2016-08-05 at 19:55 +0200, Richard Biener wrote:
Please don't use std::string.  For string building you can use
obstacks.

Just out of curiosity ... why?  I remember there was some discussion
about it, what was the conclusion?  Is that now a general rule or does
it depend on the context where strings are used?
Because you make a messy mix of string handling variants.  Std::string is not 
powerful enough to capture all uses, it is vastly more expensive to embed into 
structs and it pulls in too much headers.
Is this negotiable?  I would prefer to use the standard library 
implementation of things when possible.  At the very least, it's easier 
for others familiar with the C++ STL.  I mean, we are using C++ after 
all :).
I understand a reluctance in cases where it would be very inefficient, 
or where std::string is not up to speed.  In such cases it makes sense 
to use obstacks or equivalents, but in straightforward things on a non 
critical path?
I would gladly do either, but I would strongly prefer std::string when 
it does not overly pessimize code.
> (Oh, and I hate I/o streams even more)

Yeah, but that sounds like a personal preference? ;-).

Let me know. I'll do either if it's an agreed upon mandate from the global deities :).
Aldy

Reply via email to