Skip to content

Commit

Permalink
Merge pull request #107 from c-dilks/fix-ptr_fun-deprecation
Browse files Browse the repository at this point in the history
fix: `std::ptr_fun` is deprecated in C++11 (and removed in C++17)
  • Loading branch information
DraTeots authored Oct 2, 2024
2 parents ae623b9 + 72fe7d6 commit fcd8e3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/include/RCDB/StringUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class StringUtils {

// trim from start (in place)
static inline void 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 c) { return !isspace(c); }));
}

// trim from end (in place)
static inline void 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 c) { return !isspace(c); }).base(), s.end());
}

// trim from both ends (in place)
Expand Down

0 comments on commit fcd8e3e

Please sign in to comment.