On Wed, Aug 16, 2006 at 05:05:53PM +0200, Abdelrazak Younes wrote:
> Abdelrazak Younes wrote:
> >>Here comes the next bit: I discovered that the result of
> >>
> >>std::vector<char> ucs4_to_utf8(boost::uint32_t c)
> >>
> >>was never used as a vector. I changed it to std::string, and that 
> >>simplifies
> >>the code. In particular it removes manual fiddling with the terminating
> >>'\0', which we should not do IMHO.
> >
> >Having had a closer look at "unicode.C" it seems that all use of 
> >std::vector could be replaced by std::basic_string. We just have to 
> >replace "push_back" with "+="...
> 
> There's an added benefit if we go the basic_string way: I think most 
> compilers (gcc, msvc) now do implicit sharing on strings so passing 
> parameters won't be as costly as with std::vector().

I doubt any recent compiler does implicit sharing on strings.

Andre' 

Reply via email to