Remove Boost.Regex dependency
Travis Xenial container has Boost 1.58.0 built with GCC5 against the CXX11 ABI. However, there is a bug that affects the Regex library. Some symbols are missing [abi:cxx11] tags which causes linking to fail if not also building OSRM with GCC5. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=823978 Given there is only one use of the Regex libary, use this opportunity to replace it with std::regex and avoid the linking issue entirely.
This commit is contained in:
parent
8a49157cd8
commit
f0c8375912
@ -1,14 +1,8 @@
|
|||||||
#include "extractor/maneuver_override_relation_parser.hpp"
|
#include "extractor/maneuver_override_relation_parser.hpp"
|
||||||
#include "extractor/maneuver_override.hpp"
|
#include "extractor/maneuver_override.hpp"
|
||||||
|
|
||||||
#include "util/log.hpp"
|
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
|
||||||
#include <boost/algorithm/string/predicate.hpp>
|
|
||||||
#include <boost/algorithm/string/regex.hpp>
|
|
||||||
#include <boost/optional/optional.hpp>
|
#include <boost/optional/optional.hpp>
|
||||||
#include <boost/ref.hpp>
|
#include <boost/ref.hpp>
|
||||||
#include <boost/regex.hpp>
|
|
||||||
|
|
||||||
#include <osmium/osm.hpp>
|
#include <osmium/osm.hpp>
|
||||||
#include <osmium/tags/filter.hpp>
|
#include <osmium/tags/filter.hpp>
|
||||||
|
|||||||
@ -5,10 +5,8 @@
|
|||||||
#include "util/log.hpp"
|
#include "util/log.hpp"
|
||||||
|
|
||||||
#include <boost/algorithm/string/predicate.hpp>
|
#include <boost/algorithm/string/predicate.hpp>
|
||||||
#include <boost/algorithm/string/regex.hpp>
|
|
||||||
#include <boost/optional/optional.hpp>
|
#include <boost/optional/optional.hpp>
|
||||||
#include <boost/ref.hpp>
|
#include <boost/ref.hpp>
|
||||||
#include <boost/regex.hpp>
|
|
||||||
|
|
||||||
#include <osmium/osm.hpp>
|
#include <osmium/osm.hpp>
|
||||||
#include <osmium/tags/regex_filter.hpp>
|
#include <osmium/tags/regex_filter.hpp>
|
||||||
@ -244,14 +242,15 @@ bool RestrictionParser::ShouldIgnoreRestriction(const std::string &except_tag_st
|
|||||||
|
|
||||||
// Be warned, this is quadratic work here, but we assume that
|
// Be warned, this is quadratic work here, but we assume that
|
||||||
// only a few exceptions are actually defined.
|
// only a few exceptions are actually defined.
|
||||||
std::vector<std::string> exceptions;
|
const std::regex delimiter_re("[;][ ]*");
|
||||||
boost::algorithm::split_regex(exceptions, except_tag_string, boost::regex("[;][ ]*"));
|
std::sregex_token_iterator except_tags_begin(
|
||||||
|
except_tag_string.begin(), except_tag_string.end(), delimiter_re, -1);
|
||||||
|
std::sregex_token_iterator except_tags_end;
|
||||||
|
|
||||||
return std::any_of(
|
return std::any_of(except_tags_begin, except_tags_end, [&](const std::string ¤t_string) {
|
||||||
std::begin(exceptions), std::end(exceptions), [&](const std::string ¤t_string) {
|
return std::end(restrictions) !=
|
||||||
return std::end(restrictions) !=
|
std::find(std::begin(restrictions), std::end(restrictions), current_string);
|
||||||
std::find(std::begin(restrictions), std::end(restrictions), current_string);
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} // namespace extractor
|
} // namespace extractor
|
||||||
} // namespace osrm
|
} // namespace osrm
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user