Ovanes Markarian wrote:
I now know that this is an invalid usage, after I know that 'smatch' is based on iterators. Since 'smatch' does not encover in the docs what internal structure it has, I did not conclude that it is based on iterators. And a string const& as param does not mean for me, that this string should be valid later on. May be I am wrong.
The docs are pretty explicit about smatch using iterators. See the section "Results Invalidation" here: http://boost-sandbox.sourceforge.net/libs/xpressive/doc/html/boost_xpressive...
BTW: the trick with volatile does not work in MSVC 8.0 Express compiler. :( Would be great if the upcoming standard would provide a temporary checking facility ;)
Yes, I know. It's a compiler bug. FYI, the next standard *does* provide a way to detect temporary objects. It's called "rvalue references".
Many thanks for the great lib and your time!
My pleasure. Thanks for the feedback. -- Eric Niebler Boost Consulting www.boost-consulting.com