Replace boost::string_ref with std::string_view

This commit is contained in:
Dennis Luxen
2022-10-30 13:59:59 +01:00
parent 60e283312c
commit 0021ccef59
6 changed files with 33 additions and 32 deletions
+4 -1
View File
@@ -70,7 +70,10 @@ template <typename StringView> inline auto decompose(const StringView &lhs, cons
const auto trim = [](StringView view) {
// we compare suffixes based on this value, it might break UTF chars, but as long as we are
// consistent in handling, we do not create bad results
std::string str = boost::to_lower_copy(view.to_string());
std::string str(view);
std::transform(str.begin(), str.end(), str.begin(),
[](unsigned char c){ return std::tolower(c); } // correct
);
auto front = str.find_first_not_of(' ');
if (front == std::string::npos)
+2 -2
View File
@@ -2,14 +2,14 @@
#define OSRM_STRING_VIEW_HPP
#include <boost/functional/hash.hpp>
#include <boost/utility/string_ref.hpp>
#include <string_view>
namespace osrm
{
namespace util
{
// Convenience typedef: boost::string_ref, boost::string_view or C++17's string_view
using StringView = boost::string_ref;
using StringView = std::string_view;
} // namespace util
} // namespace osrm