
11 Apr
2012
11 Apr
'12
8:13 a.m.
On Wed, Apr 11, 2012 at 8:54 AM, Eric Niebler <eric@boostpro.com> wrote:
Calling m.str() creates a temporary std::wstring object, which incurs a dynamic allocation and is slow. Speaking for my own library (xpressive), sub_match has an optimized stream insertion operator. It should be used.
You have to construct a string somewhere, don't you? If you have one already, you could use iterator_range<const char*> instead to avoid a copy.
But my primary objection is below...
You're right, it'd be nice if that just worked. -- Olaf