std::ptr_fun replacement for c++17

后端 未结 6 2123
無奈伤痛
無奈伤痛 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:31

    According to cppreference, std::ptr_fun is deprecated since C++11 and discontinued since C++17.

    Similarly, std::not1 is deprecated since C++17.

    So best don't use either, but a lambda (as explained in other answers).

提交回复
热议问题