2
我與升壓xpressive中玩弄周圍和我遇到了下列故障片斷xpressive中>> =操作
#include <iostream>
#include <string>
#include <boost/xpressive/xpressive.hpp>
using namespace std;
using namespace boost::xpressive;
int main()
{
string s("123");
sregex rex = _d;
rex >>= _d;
smatch what;
regex_search(s, what, rex);
cout << "Match: " << what[0] << endl;
return 0;
}
運行這個程序的結果是1
匹配,而不是預期的12
。 sregex::operator>>=
有不同的含義/使用我直覺上認爲的嗎?我期待這會產生類似於_d >> _d
的sregex
。