代码:
#include <string>
#include <boost/regex.hpp>
int main() {
boost::smatch what;
boost::regex regex("some +", boost::regex::icase);
std::string mystring = "some string";
bool search_result = boost::regex_search(mystring.begin(),mystring.end(), what, regex);
}
错误消息很长,这里只有第一行:
<stdin>: In function 'int main()':
<stdin>:7:88: error: no matching function for call to 'regex_search(std::basic_string<char>::iterator, std::basic_string<char>::iterator, boost::smatch&, boost::regex&)'
<stdin>:7:88: note: candidates are:
In file included from d:\boost/boost/regex/v4/regex.hpp:148:0,
from d:\boost/boost/regex.hpp:31,
from <stdin>:2: