swh:1:snp:7a4cd2a5ec73a061be17605597c4b1660b799026
Tip revision: 5a44a1183318dd6f9b5dc5eed204695e90703a4f authored by Max Göttlicher on 15 February 2023, 10:22:34 UTC
implementing on star bound
implementing on star bound
Tip revision: 5a44a11
utility.hpp
//
// Created by max on 19.08.22.
//
#ifndef PDS_UTILITY_HPP
#define PDS_UTILITY_HPP
#include <algorithm>
namespace pds {
template<class... T>
void unused(T&&...) { }
template<typename CharT>
inline void ltrim(std::basic_string<CharT>& s) {
s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](const CharT c) { return !std::isspace(c); }));
}
template<typename CharT>
inline void rtrim(std::basic_string<CharT>& s) {
s.erase(std::find_if(s.rbegin(), s.rend(), [](const CharT c) { return !std::isspace(c); }).base(), s.end());
}
template<typename CharT>
inline void trim(std::basic_string<CharT>& s) {
ltrim(s);
rtrim(s);
}
}
#endif //PDS_UTILITY_HPP