Replaces deprecated code with lambdas

develop
Josh Cooper 2022-06-05 13:05:30 -07:00 committed by Myk
parent f8d46a10c1
commit cec8a358b5
1 changed files with 2 additions and 2 deletions

@ -174,13 +174,13 @@ static inline void set_to_limit(int &value, const int maximum, const int min = 0
// trim from start // trim from start
static inline std::string &ltrim(std::string &s) { static inline std::string &ltrim(std::string &s) {
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace)))); s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](char x){ return !std::isspace(x); }));
return s; return s;
} }
// trim from end // trim from end
static inline std::string &rtrim(std::string &s) { static inline std::string &rtrim(std::string &s) {
s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); s.erase(std::find_if(s.rbegin(), s.rend(), [](char x){ return !std::isspace(x); }).base(), s.end());
return s; return s;
} }