diff --git a/Extractor/ExtractorCallbacks.cpp b/Extractor/ExtractorCallbacks.cpp index 775afabcc..8647677c9 100644 --- a/Extractor/ExtractorCallbacks.cpp +++ b/Extractor/ExtractorCallbacks.cpp @@ -61,13 +61,12 @@ void ExtractorCallbacks::ProcessNode(const osmium::Node &osm_input_node, } void ExtractorCallbacks::ProcessRestriction( - const boost::optional &restriction) + const mapbox::util::optional &restriction) { - if (!restriction.is_initialized()) + if (restriction) { - return; + external_memory.restrictions_list.push_back(restriction.get()); } - external_memory.restrictions_list.push_back(restriction.get()); } /** warning: caller needs to take care of synchronization! */ void ExtractorCallbacks::ProcessWay(const osmium::Way &input_way, ExtractionWay &parsed_way) diff --git a/Extractor/ExtractorCallbacks.h b/Extractor/ExtractorCallbacks.h index 692a942b9..e43b02b52 100644 --- a/Extractor/ExtractorCallbacks.h +++ b/Extractor/ExtractorCallbacks.h @@ -31,10 +31,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ExtractionWay.h" #include "../typedefs.h" -#include - #include +#include + #include #include @@ -59,7 +59,7 @@ class ExtractorCallbacks void ProcessNode(const osmium::Node ¤t_node, const ExtractionNode &result_node); // warning: caller needs to take care of synchronization! - void ProcessRestriction(const boost::optional &restriction); + void ProcessRestriction(const mapbox::util::optional &restriction); // warning: caller needs to take care of synchronization! void ProcessWay(const osmium::Way ¤t_way, ExtractionWay &result_way); diff --git a/Extractor/RestrictionParser.cpp b/Extractor/RestrictionParser.cpp index f3ba4104a..785c4c102 100644 --- a/Extractor/RestrictionParser.cpp +++ b/Extractor/RestrictionParser.cpp @@ -89,12 +89,12 @@ void RestrictionParser::ReadRestrictionExceptions() } } -boost::optional RestrictionParser::TryParse(osmium::Relation &relation) const +mapbox::util::optional RestrictionParser::TryParse(osmium::Relation &relation) const { // return if turn restrictions should be ignored if (!use_turn_restrictions) { - return boost::optional(); + return mapbox::util::optional(); } osmium::tags::KeyPrefixFilter filter(false); @@ -108,7 +108,7 @@ boost::optional RestrictionParser::TryParse(osmium::R // if it's a restriction, continue; if (std::distance(fi_begin, fi_end) == 0) { - return boost::optional(); + return mapbox::util::optional(); } // check if the restriction should be ignored @@ -117,7 +117,7 @@ boost::optional RestrictionParser::TryParse(osmium::R { if (ShouldIgnoreRestriction(except)) { - return boost::optional(); + return mapbox::util::optional(); } } @@ -198,7 +198,7 @@ boost::optional RestrictionParser::TryParse(osmium::R // << restriction_container.restriction.via.node << "->" << restriction_container.restriction.to.node // << ">"; - return boost::optional(restriction_container); + return mapbox::util::optional(restriction_container); } bool RestrictionParser::ShouldIgnoreRestriction(const std::string &except_tag_string) const diff --git a/Extractor/RestrictionParser.h b/Extractor/RestrictionParser.h index 433a46e85..e428e6166 100644 --- a/Extractor/RestrictionParser.h +++ b/Extractor/RestrictionParser.h @@ -30,12 +30,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "../DataStructures/Restriction.h" -#include - #include #include - +#include #include #include @@ -48,7 +46,7 @@ class RestrictionParser public: RestrictionParser(ScriptingEnvironment &scripting_environment); - boost::optional TryParse(osmium::Relation& relation) const; + mapbox::util::optional TryParse(osmium::Relation& relation) const; void ReadUseRestrictionsSetting(); void ReadRestrictionExceptions();