#include <algorithm>
#include <cctype>
#include <iostream>
using namespace std;
#define weapon_type int
weapon_type str_to_weapon(const string &str)
{
string str_nospace = str;
str_nospace.erase(remove_if(str_nospace.begin(), str_nospace.end(), isspace), str_nospace.end());
/*
if (_str_to_weapon_map.count(str_nospace)) {
return _str_to_weapon_map[str_nospace];
} else {
return WPN_UNKNOWN;
}
*/
}
int main() {
return 0;
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNjdHlwZT4KI2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKI2RlZmluZSB3ZWFwb25fdHlwZSBpbnQKCndlYXBvbl90eXBlIHN0cl90b193ZWFwb24oY29uc3Qgc3RyaW5nICZzdHIpCnsKICAgIHN0cmluZyBzdHJfbm9zcGFjZSA9IHN0cjsKICAgIHN0cl9ub3NwYWNlLmVyYXNlKHJlbW92ZV9pZihzdHJfbm9zcGFjZS5iZWdpbigpLCBzdHJfbm9zcGFjZS5lbmQoKSwgaXNzcGFjZSksIHN0cl9ub3NwYWNlLmVuZCgpKTsKCiAgICAvKgogICAgaWYgKF9zdHJfdG9fd2VhcG9uX21hcC5jb3VudChzdHJfbm9zcGFjZSkpIHsKICAgICAgICByZXR1cm4gX3N0cl90b193ZWFwb25fbWFwW3N0cl9ub3NwYWNlXTsKICAgIH0gZWxzZSB7CiAgICAgICAgcmV0dXJuIFdQTl9VTktOT1dOOwogICAgfQogICAgKi8KfQoKaW50IG1haW4oKSB7CglyZXR1cm4gMDsKfQ==
prog.cpp: In function ‘int str_to_weapon(const string&)’:
prog.cpp:11:80: error: no matching function for call to ‘remove_if(std::basic_string<char>::iterator, std::basic_string<char>::iterator, <unresolved overloaded function type>)’
str_nospace.erase(remove_if(str_nospace.begin(), str_nospace.end(), isspace), str_nospace.end());
^
prog.cpp:11:80: note: candidate is:
In file included from /usr/include/c++/4.8/algorithm:62:0,
from prog.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:1158:5: note: template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)
remove_if(_ForwardIterator __first, _ForwardIterator __last,
^
/usr/include/c++/4.8/bits/stl_algo.h:1158:5: note: template argument deduction/substitution failed:
prog.cpp:11:80: note: couldn't deduce template parameter ‘_Predicate’
str_nospace.erase(remove_if(str_nospace.begin(), str_nospace.end(), isspace), str_nospace.end());
^
prog.cpp:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^