4 ms·
See slide 42 of STL's recent talk for what I guess will be a similar example: https://github.com/CppCon/CppCon2014/tree/master/Presentations/STL%20Features%20An
by pbsd 12y ago
See slide 42 of STL's recent talk for what I guess will be a similar example: https://github.com/CppCon/CppCon2014/tree/master/Presentations/STL%20Features%20And%20Implementation%20Techniques%20-%20Stephan%20T.%20Lavavej%20-%20CppCon%202014 https://github.com/CppCon/CppCon2014/tree/master/Presentatio...
- dbaupp 12y agoReproduced here: const regex r(R"(meow(\d+)\.txt)"); smatch m; if (regex_match(dir_iter->path().filename().string(), m, r)) { DoSomethingWith(m[1]); } - What's wrong with this code? - Haqrsvarq orunivbe va P++11 - Pbzcvyre reebe va P++14 - .fgevat() ergheaf n grzcbenel fgq::fgevat - z[1] pbagnvaf vgrengbef gb n qrfgeblrq grzcbenel (http://rot13.com/ http://rot13.com/ 'd if you want to guess.)
- nikbackm 12y agoSeems like this was fixed in C++14 by adding a std::string&& overload. http://en.cppreference.com/w/cpp/regex/regex_match http://en.cppreference.com/w/cpp/regex/regex_match
- dbaupp 12y agoThe underlying problem is still there, fixing a few of the worst cases in the standard library is helpful but only up to a point. (E.g. anyone with a custom function that does something in a similar vein needs to remember to do the same.)