Boost logo

Boost :

From: Matus Chochlik (chochlik_at_[hidden])
Date: 2008-06-10 02:15:19


On Tue, Jun 10, 2008 at 1:31 AM, Frank Birbacher <bloodymir.crap_at_[hidden]> wrote:
> Hi!
>
> Matus Chochlik schrieb:
>>>
>>> Other difference is my use of std::string as a return type. Seems you
>>> have a complex system to compute string length and use char*. Not sure
>>> which one is the best but I'm willing to hear the rationale behind this
>>> choice.
>>
>> Well there is no bulletproof ;) rationale behind this. I've made some
>> performance
>> tests with both char* buffer and with ::std::string and char* buffer did
>> better.
>> When formatting the type name of a complicated template there is a lot of
>> string copying and realocation.
>
> Which is why there is a stringstream. You won't return anything but instead
> write into a ostream& directly. This reduces the complexity of the
> algorithm.

Well, unless you want to do something else with the type name
besides writing it into an ostream ;)

>
> Frank
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>

-- 
________________
::matus_chochlik

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk