On Feb 14, 2014, at 4:31 PM, David Blaikie <[email protected]> wrote:
The return value from find is going to be an iterator that “points” into a destructed regex. As soon as you use it for anything, you’re (hopefully) going to go boom. The “fix” for this is easy. regex meow { “meow” }; std::find(sregex_iterator(s.begin(), s.end(), meow), end, "foo”); Now you can control the lifetime of the regex, and make sure that it doesn’t get destroyed too early. For those following along at home, the standard issue (which was adopted for C++14) is here: and a closely related one (also part of the C++14 standard): Here’s a revised patch that covers both of them. — Marshall |
LWG2332-2.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
