std::ptr_fun replacement for c++17

后端 未结 6 2229
無奈伤痛
無奈伤痛 2021-02-04 00:11

I am using std::ptr_fun as follows:

static inline std::string <rim(std::string &s) {
    s.erase(s.begin(), std::find_if(s.begin(), s.end(         


        
6条回答
  •  耶瑟儿~
    2021-02-04 00:40

    Alternatively, you might use std::not_fn:

    static inline std::string <rim(std::string &s) {
        s.erase(s.begin(), std::find_if(s.begin(), s.end(),
            std::not_fn(static_cast(std::isspace))));
        return s;
    }
    

提交回复
热议问题