#include <boost/regex.hpp>
int main(int argc, char* argv[], char* env[])
{
typedef boost::match_results<std::string::const_iterator> matches_t;
typedef matches_t::const_reference match_t;
boost::regex x("");
const std::string str;
matches_t what;
boost::match_flag_type flags = boost::match_default;
regex_search(str.begin(), str.end(), what, x, flags);
return 0;
}
Three issues - string is in std namespace, requires to be called out accordingly. Second the regex_search template defines an iterator for a const string so declare it that way. Lastly regex_search is not part of boost namespace and there was a typo in the regex_seRAch. The above compiles and executes fine against boost 1.53.