Skip to content

Commit

Permalink
Merge pull request #45 from lrusak/c++17
Browse files Browse the repository at this point in the history
StringUtils: fix build with -std=c++17
  • Loading branch information
opdenkamp committed Sep 14, 2020
2 parents 1133ccc + a0d1a41 commit a7cd0d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/StringUtils.cpp
Expand Up @@ -453,7 +453,7 @@ static int isspace_c(char c)

std::string& StringUtils::TrimLeft(std::string &str)
{
str.erase(str.begin(), ::find_if(str.begin(), str.end(), ::not1(::ptr_fun(isspace_c))));
str.erase(str.begin(), ::find_if(str.begin(), str.end(), [](char s) { return isspace_c(s) == 0; }));
return str;
}

Expand All @@ -466,7 +466,7 @@ std::string& StringUtils::TrimLeft(std::string &str, const char* const chars)

std::string& StringUtils::TrimRight(std::string &str)
{
str.erase(::find_if(str.rbegin(), str.rend(), ::not1(::ptr_fun(isspace_c))).base(), str.end());
str.erase(::find_if(str.rbegin(), str.rend(), [](char s) { return isspace_c(s) == 0; }).base(), str.end());
return str;
}

Expand Down

0 comments on commit a7cd0d5

Please sign in to comment.