From 72fe7d61a72b447b34518861e400e1b1696b57b8 Mon Sep 17 00:00:00 2001 From: Christopher Dilks Date: Mon, 30 Sep 2024 17:33:53 -0400 Subject: [PATCH] fix: `std::ptr_fun` is deprecated in C++11 (and removed in C++17) --- cpp/include/RCDB/StringUtils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/include/RCDB/StringUtils.h b/cpp/include/RCDB/StringUtils.h index 73631754..2d5eeb9c 100644 --- a/cpp/include/RCDB/StringUtils.h +++ b/cpp/include/RCDB/StringUtils.h @@ -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(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(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)