From: Christophe de V. <cde...@al...> - 2004-05-05 09:53:53
|
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 |