|
Boost Users : |
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2007-10-16 07:27:30
Hello Eric,
this code fragment will crash, since 'what' uses iterators into the invalid
string
x::smatch what;
if(x::regex_match(std::string(" (some_type_ptr) xyz,"), what,
regex)) //string goes out of scope after this sentance
{
std::cout << what[0] << endl; // boom! string iterators are no
longer valid
std::cout << what[1] << endl;
}
May be there is a way to probit this kind of behaviour during the
compilation or at least this can be stated in the docs...
With Kind Regards,
Ovanes
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net