Re: [libxml++] program crashes when parsing XML with accent



Jonathan Wakely wrote:

On Tue, May 04, 2004 at 11:13:54PM +0200, Christophe de Vienne wrote:

Christophe de Vienne wrote:
The solution is, I think, to instanciate like this :
Glib::ustring( std::string(ch, len) )
This should not make unecessary buffer copy with g++ 3.x at least, since std::string has a COW implementation, and Glib::ustring constructor taking a std::string just copy it.

How about using this ctor taking an iterator range:

   template <class InputIterator>
       Glib::ustring::ustring(InputIterator begin, InputIterator end);
<snip>

It's so evident it's the right solution I'm ashamed I didn't see it !

I'll commit this ASAP.

Christophe





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]