diff --git a/include/engine/guidance/route_step.hpp b/include/engine/guidance/route_step.hpp index 870373817..89e2ab143 100644 --- a/include/engine/guidance/route_step.hpp +++ b/include/engine/guidance/route_step.hpp @@ -14,7 +14,7 @@ #include #include -#include +#include namespace osrm::engine::guidance { @@ -220,14 +220,14 @@ inline auto RouteStep::LanesToTheLeft() const { const auto &description = intersections.front().lane_description; LaneID num_lanes_left = NumLanesToTheLeft(); - return boost::make_iterator_range(description.begin(), description.begin() + num_lanes_left); + return std::ranges::subrange(description.begin(), description.begin() + num_lanes_left); } inline auto RouteStep::LanesToTheRight() const { const auto &description = intersections.front().lane_description; LaneID num_lanes_right = NumLanesToTheRight(); - return boost::make_iterator_range(description.end() - num_lanes_right, description.end()); + return std::ranges::subrange(description.end() - num_lanes_right, description.end()); } } // namespace osrm::engine::guidance diff --git a/include/extractor/class_data.hpp b/include/extractor/class_data.hpp index 87945a0b0..27e88e8a4 100644 --- a/include/extractor/class_data.hpp +++ b/include/extractor/class_data.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace osrm::extractor { diff --git a/include/extractor/node_restriction_map.hpp b/include/extractor/node_restriction_map.hpp index 6c65a6592..bf5673125 100644 --- a/include/extractor/node_restriction_map.hpp +++ b/include/extractor/node_restriction_map.hpp @@ -26,7 +26,7 @@ template class NodeRestrictionMap // Find all restrictions applicable to (from,via,*) turns auto Restrictions(NodeID from, NodeID via) const { - return getRange(from, via) | boost::adaptors::filtered(index_filter); + return getRange(from, via) | std::views::filter(index_filter); }; // Find all restrictions applicable to (from,via,to) turns @@ -34,7 +34,7 @@ template class NodeRestrictionMap { const auto turnFilter = [this, to](const auto &restriction) { return index_filter(restriction) && restriction->IsTurnRestricted(to); }; - return getRange(from, via) | boost::adaptors::filtered(turnFilter); + return getRange(from, via) | std::views::filter(turnFilter); }; private: diff --git a/include/extractor/restriction_graph.hpp b/include/extractor/restriction_graph.hpp index 4a4d61bf8..51f660eeb 100644 --- a/include/extractor/restriction_graph.hpp +++ b/include/extractor/restriction_graph.hpp @@ -6,7 +6,7 @@ #include "util/node_based_graph.hpp" #include "util/std_hash.hpp" #include "util/typedefs.hpp" - +#include #include namespace osrm::extractor @@ -102,9 +102,9 @@ struct RestrictionGraph friend restriction_graph_details::transferBuilder; friend RestrictionGraph constructRestrictionGraph(const std::vector &); - using EdgeRange = boost::iterator_range::const_iterator>; + using EdgeRange = std::ranges::subrange::const_iterator>; using RestrictionRange = - boost::iterator_range::const_iterator>; + std::ranges::subrange::const_iterator>; using EdgeKey = std::pair; // Helper functions for iterating over node restrictions and edges diff --git a/include/partitioner/bisection_graph_view.hpp b/include/partitioner/bisection_graph_view.hpp index e3a62aaf1..a92017320 100644 --- a/include/partitioner/bisection_graph_view.hpp +++ b/include/partitioner/bisection_graph_view.hpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include @@ -40,7 +40,7 @@ class BisectionGraphView // Iteration over all nodes (direct access into the node) ConstNodeIterator Begin() const; ConstNodeIterator End() const; - auto Nodes() const { return boost::make_iterator_range(begin, end); } + auto Nodes() const { return std::ranges::subrange(begin, end); } // Re-Construct the ID of a node from a reference NodeID GetID(const NodeT &node) const; diff --git a/include/util/bit_range.hpp b/include/util/bit_range.hpp index 52a74ac95..530ff79d7 100644 --- a/include/util/bit_range.hpp +++ b/include/util/bit_range.hpp @@ -4,7 +4,7 @@ #include "util/msb.hpp" #include -#include +#include namespace osrm::util { @@ -88,7 +88,7 @@ class BitIterator : public boost::iterator_facade, // Returns range over all 1 bits of value template auto makeBitRange(const T value) { - return boost::make_iterator_range(BitIterator{value}, BitIterator{}); + return std::ranges::subrange(BitIterator{value}, BitIterator{}); } } // namespace osrm::util diff --git a/src/engine/routing_algorithms/many_to_many_ch.cpp b/src/engine/routing_algorithms/many_to_many_ch.cpp index d021a52e7..b71b9f072 100644 --- a/src/engine/routing_algorithms/many_to_many_ch.cpp +++ b/src/engine/routing_algorithms/many_to_many_ch.cpp @@ -2,7 +2,7 @@ #include "engine/routing_algorithms/routing_base_ch.hpp" #include -#include +#include #include #include @@ -106,7 +106,7 @@ void forwardRoutingStep(const DataFacade &facade, search_space_with_buckets.end(), heapNode.node, NodeBucket::Compare()); - for (const auto ¤t_bucket : boost::make_iterator_range(bucket_list)) + for (const auto ¤t_bucket : std::ranges::subrange(bucket_list.first, bucket_list.second)) { // Get target id from bucket entry const auto column_index = current_bucket.column_index; diff --git a/src/engine/routing_algorithms/many_to_many_mld.cpp b/src/engine/routing_algorithms/many_to_many_mld.cpp index 0949c7488..a40dbaf3d 100644 --- a/src/engine/routing_algorithms/many_to_many_mld.cpp +++ b/src/engine/routing_algorithms/many_to_many_mld.cpp @@ -2,7 +2,7 @@ #include "engine/routing_algorithms/routing_base_mld.hpp" #include -#include +#include #include #include @@ -428,7 +428,7 @@ void forwardRoutingStep(const DataFacade &facade, search_space_with_buckets.end(), heapNode.node, NodeBucket::Compare()); - for (const auto ¤t_bucket : boost::make_iterator_range(bucket_list)) + for (const auto ¤t_bucket : std::ranges::subrange(bucket_list.first, bucket_list.second)) { // Get target id from bucket entry const auto column_idx = current_bucket.column_index; diff --git a/src/extractor/edge_based_graph_factory.cpp b/src/extractor/edge_based_graph_factory.cpp index ae46d58af..624af1423 100644 --- a/src/extractor/edge_based_graph_factory.cpp +++ b/src/extractor/edge_based_graph_factory.cpp @@ -968,11 +968,8 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges( buffer->continuous_data.push_back(edge_with_data); // get conditional restrictions that apply to this turn - const auto &restrictions = - conditional_node_restriction_map.Restrictions( - incoming_edge.node, - outgoing_edge.node, - outgoing_edge_target); + auto restrictions = conditional_node_restriction_map.Restrictions( + incoming_edge.node, outgoing_edge.node, outgoing_edge_target); for (const auto &restriction : restrictions) { buffer->conditionals.push_back( diff --git a/src/extractor/intersection/intersection_analysis.cpp b/src/extractor/intersection/intersection_analysis.cpp index 7ee296f11..2850e0623 100644 --- a/src/extractor/intersection/intersection_analysis.cpp +++ b/src/extractor/intersection/intersection_analysis.cpp @@ -424,13 +424,11 @@ double findEdgeLength(const IntersectionEdgeGeometries &geometries, const EdgeID } template -bool isTurnRestricted(const RestrictionsRange &restrictions, const NodeID to) +bool isTurnRestricted(RestrictionsRange restrictions, const NodeID to) { // Check if any of the restrictions would prevent a turn to 'to' - return std::any_of(restrictions.begin(), - restrictions.end(), - [&to](const auto &restriction) - { return restriction->IsTurnRestricted(to); }); + return std::ranges::any_of( + restrictions, [&to](const auto &restriction) { return restriction->IsTurnRestricted(to); }); } bool isTurnAllowed(const util::NodeBasedDynamicGraph &graph, diff --git a/src/extractor/restriction_graph.cpp b/src/extractor/restriction_graph.cpp index 6b931f78c..a733564b2 100644 --- a/src/extractor/restriction_graph.cpp +++ b/src/extractor/restriction_graph.cpp @@ -276,16 +276,16 @@ RestrictionGraph constructRestrictionGraph(const std::vector &t RestrictionGraph::RestrictionRange RestrictionGraph::GetRestrictions(RestrictionID id) const { const auto &node = nodes[id]; - return boost::make_iterator_range(restrictions.begin() + node.restrictions_begin_idx, - restrictions.begin() + node.restrictions_begin_idx + - node.num_restrictions); + return std::ranges::subrange(restrictions.begin() + node.restrictions_begin_idx, + restrictions.begin() + node.restrictions_begin_idx + + node.num_restrictions); } RestrictionGraph::EdgeRange RestrictionGraph::GetEdges(RestrictionID id) const { const auto &node = nodes[id]; - return boost::make_iterator_range(edges.begin() + node.edges_begin_idx, - edges.begin() + node.edges_begin_idx + node.num_edges); + return std::ranges::subrange(edges.begin() + node.edges_begin_idx, + edges.begin() + node.edges_begin_idx + node.num_edges); } } // namespace osrm::extractor