#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
std::string str = "/test param 12 1";
str.erase(std::remove_if(str.begin(), str.end(), isspace), str.end());
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
str[0] = '_';
cout << str << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgCnsKCXN0ZDo6c3RyaW5nIHN0ciA9ICIvdGVzdCBwYXJhbSAxMiAgMSI7CglzdHIuZXJhc2Uoc3RkOjpyZW1vdmVfaWYoc3RyLmJlZ2luKCksIHN0ci5lbmQoKSwgaXNzcGFjZSksIHN0ci5lbmQoKSk7CglzdGQ6OnRyYW5zZm9ybShzdHIuYmVnaW4oKSwgc3RyLmVuZCgpLCBzdHIuYmVnaW4oKSwgOjp0b2xvd2VyKTsKCXN0clswXSA9ICdfJzsKCWNvdXQgPDwgc3RyIDw8IGVuZGw7CglyZXR1cm4gMDsKfQ==
prog.cpp: In function 'int main()':
prog.cpp:9:58: error: no matching function for call to 'remove_if(std::basic_string<char>::iterator, std::basic_string<char>::iterator, <unresolved overloaded function type>)'
str.erase(std::remove_if(str.begin(), str.end(), isspace), str.end());
^
prog.cpp:9:58: note: candidate is:
In file included from /usr/include/c++/4.9/algorithm:62:0,
from prog.cpp:2:
/usr/include/c++/4.9/bits/stl_algo.h:926:5: note: template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)
remove_if(_ForwardIterator __first, _ForwardIterator __last,
^
/usr/include/c++/4.9/bits/stl_algo.h:926:5: note: template argument deduction/substitution failed:
prog.cpp:9:58: note: couldn't deduce template parameter '_Predicate'
str.erase(std::remove_if(str.begin(), str.end(), isspace), str.end());
^