48static inline void ltrim(std::string &s)
50 s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](
int ch) { return !std::isspace(ch); }));
55static inline void rtrim(std::string &s)
57 s.erase(std::find_if(s.rbegin(), s.rend(), [](
int ch) { return !std::isspace(ch); }).base(), s.end());
62static inline void trim(std::string &s)
74 double diff = fabs(a - b);
78 if (diff <= fmax(fabs(a), fabs(b)) * reltol)
88 for (
unsigned int start = 0, end = length-1; start < end; start++, end--)
91 array[start] = array[end];
const double DOUBLEEQUAL_RELTOL
Definition Util.h:69
static void ltrim(std::string &s)
Definition Util.h:48
void reverseArray(T *array, unsigned int length)
Definition Util.h:85
static void trim(std::string &s)
Definition Util.h:62
const double DOUBLEEQUAL_ABSTOL
Definition Util.h:68
static bool almostEqualRelativeAndAbs(double a, double b, double reltol=DOUBLEEQUAL_RELTOL, double abstol=DOUBLEEQUAL_ABSTOL)
Definition Util.h:72
static void rtrim(std::string &s)
Definition Util.h:55