Lars Gullik Bjønnes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:

| Andre Poenitz wrote:
| > 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.
| | I meant the STL library packaged with the compiler.

It seems that most library vendors are moving away from std::string
implemented with reference counting. Better performance without,
especially on threaded systems.

Indeed, I have read quite a bit on so called COW (Copy-On-write) this week-end. It seems that it's the only safe and fast way to work on multi-threaded application.

Abdel.

Reply via email to