From cfc2e3e8d1065ff4d2595c6c684bd59d6d107713 Mon Sep 17 00:00:00 2001 From: "Mr.Hope" Date: Wed, 13 Dec 2023 18:10:40 +0800 Subject: [PATCH] feat: remove deprecations --- deps/limonp/StringUtil.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deps/limonp/StringUtil.hpp b/deps/limonp/StringUtil.hpp index ad3be56..057c65b 100644 --- a/deps/limonp/StringUtil.hpp +++ b/deps/limonp/StringUtil.hpp @@ -92,7 +92,7 @@ inline std::string& LTrim(std::string &s) { })); #else // Use lower version of MSVC - s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun(IsSpace)))); + s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](unsigned char c) { return std::isspace(c) == 0; })); #endif return s; } @@ -105,7 +105,7 @@ inline std::string& RTrim(std::string &s) { }).base(), s.end()); #else // Use lower version of MSVC - s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun(IsSpace))).base(), s.end()); + s.erase(std::find_if(s.rbegin(), s.rend(), [](unsigned char c) { return std::isspace(c) == 0; }).base(), s.end()); #endif return s; } @@ -119,7 +119,7 @@ inline std::string& LTrim(std::string& s, char x) { s.erase(s.begin(), std::find_if(s.begin(), s.end(), [x](unsigned char c) { return !std::isspace(c) && c != x; })); #else - s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::bind2nd(std::equal_to(), x)))); + s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not_fn(std::bind(std::equal_to(), std::placeholders::_1, x)))); #endif return s; } @@ -129,7 +129,7 @@ inline std::string& RTrim(std::string& s, char x) { s.erase(std::find_if(s.rbegin(), s.rend(), [x](unsigned char c) { return !std::isspace(c) && c != x; }).base(), s.end()); #else - s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::bind2nd(std::equal_to(), x))).base(), s.end()); + s.erase(std::find_if(s.rbegin(), s.rend(), std::not_fn(std::bind(std::equal_to(), std::placeholders::_1, x))).base(), s.end()); #endif return s; }