Skip to content
Snippets Groups Projects
Commit cf472752 authored by Jason Hiser's avatar Jason Hiser :tractor:
Browse files

Updates for c++17

parent 6cbb68d1
Branches master
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ myenv=env.Clone()
#myenv=myenv.Clone(CPPPATH=Split(cpppath))
# $SECURITY_TRANSFORMS_HOME/libtransform/include
CPPFLAGS="--std=c++11"
CPPFLAGS="--std=c++17"
myenv.Append(CPPFLAGS=CPPFLAGS)
#LIBPATH="$SECURITY_TRANSFORMS_HOME/lib"
......
......@@ -17,6 +17,9 @@
#include <limits.h>
#include <stdlib.h>
#include <assert.h>
#include <algorithm>
#include <cctype>
#include <string>
using namespace std;
......@@ -196,6 +199,7 @@ void parse_args(int argc, char* argv[])
}
/*
// trim from start (in place)
static inline void ltrim(std::string &s) {
......@@ -208,6 +212,17 @@ 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());
}
*/
static inline void ltrim(std::string &s) {
s.erase(s.begin(), std::find_if(s.begin(), s.end(),
[](unsigned char ch) { return !std::isspace(ch); }));
}
static inline void rtrim(std::string &s) {
s.erase(std::find_if(s.rbegin(), s.rend(),
[](unsigned char ch) { return !std::isspace(ch); }).base(), s.end());
}
// trim from both ends (in place)
static inline void trim(std::string &s) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment