Change use of std::not1 and std::ptr_fun to use lambdas (#77)

Change use of std::not1 and std::mem_fun to lambdas due to c++17 deprecations (closes #75)
0.8
Kurt Slagle 2017-09-27 12:56:57 -05:00 committed by Bruno Van de Velde
parent e3b2eb65bc
commit d7362005ba
1 changed files with 2 additions and 2 deletions

View File

@ -165,8 +165,8 @@ namespace tgui
std::string trim(std::string str) std::string trim(std::string str)
{ {
str.erase(str.begin(), std::find_if(str.begin(), str.end(), std::not1(std::ptr_fun<int, int>(std::isspace)))); str.erase(str.begin(), std::find_if(str.begin(), str.end(), [](int c) { return !std::isspace(c); }));
str.erase(std::find_if(str.rbegin(), str.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), str.end()); str.erase(std::find_if(str.rbegin(), str.rend(), [](int c) { return !std::isspace(c); }).base(), str.end());
return str; return str;
} }