Replace boost::string_ref with std::string_view
This commit is contained in:
@@ -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,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
|
||||
|
||||
Reference in New Issue
Block a user