2016-09-13 78 views
1

這看起來簡單直白,但在調用f(m)時出現頁面「失敗的替換」時失敗。這是爲什麼?爲什麼在使用smatch :: str時mem_fn無法編譯?

string const input = "The quick brown fox."; 
std::regex const words("[^\\s]+"); 

auto f = std::mem_fn(&std::smatch::str); 
std::sregex_iterator i = std::sregex_iterator(input.begin(), input.end(), words); 
std::smatch m = *i; 

string first_word = f(m); 

http://ideone.com/nsN8A1

回答

相關問題