我正在如下使用std::ptr_fun
:
static inline std::string <rim(std::string &s) {
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
return s;
}
这个答案中提到,然而这段代码在使用C++17(在Microsoft Visual Studio 2017上)时无法编译,会出现以下错误:error C2039: 'ptr_fun': is not a member of 'std'
这个问题怎么能够解决?
std::not_fn(::isspace)
。 - Holt