diff --git a/.clang-tidy b/.clang-tidy index 03f7f39d2..229e2e69a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -49,6 +49,8 @@ Checks: > -misc-misplaced-const, -misc-definitions-in-headers, -misc-unused-parameters, + modernize-concat-nested-namespaces, + modernize-use-using, performance-*, -performance-noexcept-move-constructor, -performance-no-int-to-ptr, diff --git a/include/contractor/contract_excludable_graph.hpp b/include/contractor/contract_excludable_graph.hpp index 2f49e68eb..05567f287 100644 --- a/include/contractor/contract_excludable_graph.hpp +++ b/include/contractor/contract_excludable_graph.hpp @@ -7,9 +7,7 @@ #include "contractor/graph_contractor_adaptors.hpp" #include "contractor/query_graph.hpp" -namespace osrm -{ -namespace contractor +namespace osrm::contractor { using GraphAndFilter = std::tuple>>; @@ -94,7 +92,6 @@ inline auto contractExcludableGraph(ContractorGraph contractor_graph_, return GraphAndFilter{QueryGraph{num_nodes, edge_container.edges}, edge_container.MakeEdgeFilters()}; } -} // namespace contractor } // namespace osrm #endif diff --git a/include/contractor/contracted_edge_container.hpp b/include/contractor/contracted_edge_container.hpp index db3ae5cc9..89affa65a 100644 --- a/include/contractor/contracted_edge_container.hpp +++ b/include/contractor/contracted_edge_container.hpp @@ -14,9 +14,7 @@ #include #include -namespace osrm -{ -namespace contractor +namespace osrm::contractor { struct ContractedEdgeContainer @@ -164,7 +162,6 @@ struct ContractedEdgeContainer std::vector flags; std::vector edges; }; -} // namespace contractor } // namespace osrm #endif diff --git a/include/contractor/contracted_metric.hpp b/include/contractor/contracted_metric.hpp index c795a139a..184e6aae2 100644 --- a/include/contractor/contracted_metric.hpp +++ b/include/contractor/contracted_metric.hpp @@ -3,9 +3,7 @@ #include "contractor/query_graph.hpp" -namespace osrm -{ -namespace contractor +namespace osrm::contractor { namespace detail @@ -19,7 +17,6 @@ template struct ContractedMetric using ContractedMetric = detail::ContractedMetric; using ContractedMetricView = detail::ContractedMetric; -} // namespace contractor } // namespace osrm #endif diff --git a/include/contractor/contractor.hpp b/include/contractor/contractor.hpp index a0335d8ea..5db562e30 100644 --- a/include/contractor/contractor.hpp +++ b/include/contractor/contractor.hpp @@ -30,9 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "contractor/contractor_config.hpp" -namespace osrm -{ -namespace contractor +namespace osrm::contractor { /// Base class of osrm-contract @@ -49,7 +47,6 @@ class Contractor private: ContractorConfig config; }; -} // namespace contractor } // namespace osrm #endif // PROCESSING_CHAIN_HPP diff --git a/include/contractor/contractor_config.hpp b/include/contractor/contractor_config.hpp index 18e8ae222..164065cb0 100644 --- a/include/contractor/contractor_config.hpp +++ b/include/contractor/contractor_config.hpp @@ -35,9 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -namespace osrm -{ -namespace contractor +namespace osrm::contractor { struct ContractorConfig final : storage::IOConfig @@ -71,7 +69,6 @@ struct ContractorConfig final : storage::IOConfig //(e.g. 0.8 contracts 80 percent of the hierarchy, leaving a core of 20%) double core_factor = 1.0; }; -} // namespace contractor } // namespace osrm #endif // EXTRACTOR_OPTIONS_HPP diff --git a/include/contractor/contractor_graph.hpp b/include/contractor/contractor_graph.hpp index e8cef068a..13d44985f 100644 --- a/include/contractor/contractor_graph.hpp +++ b/include/contractor/contractor_graph.hpp @@ -4,9 +4,7 @@ #include "util/dynamic_graph.hpp" #include -namespace osrm -{ -namespace contractor +namespace osrm::contractor { struct ContractorEdgeData @@ -42,7 +40,6 @@ struct ContractorEdgeData using ContractorGraph = util::DynamicGraph; using ContractorEdge = ContractorGraph::InputEdge; -} // namespace contractor } // namespace osrm #endif // OSRM_CONTRACTOR_CONTRACTOR_GRAPH_HPP_ diff --git a/include/contractor/contractor_heap.hpp b/include/contractor/contractor_heap.hpp index 7f505bb8a..79fce9df5 100644 --- a/include/contractor/contractor_heap.hpp +++ b/include/contractor/contractor_heap.hpp @@ -5,9 +5,7 @@ #include "util/typedefs.hpp" #include "util/xor_fast_hash_storage.hpp" -namespace osrm -{ -namespace contractor +namespace osrm::contractor { struct ContractorHeapData { @@ -24,7 +22,6 @@ using ContractorHeap = util::QueryHeap>; -} // namespace contractor } // namespace osrm #endif // OSRM_CONTRACTOR_CONTRACTOR_HEAP_HPP_ diff --git a/include/contractor/contractor_search.hpp b/include/contractor/contractor_search.hpp index 246228980..ebc0b40b9 100644 --- a/include/contractor/contractor_search.hpp +++ b/include/contractor/contractor_search.hpp @@ -8,9 +8,7 @@ #include -namespace osrm -{ -namespace contractor +namespace osrm::contractor { void search(ContractorHeap &heap, @@ -20,7 +18,6 @@ void search(ContractorHeap &heap, const EdgeWeight weight_limit, const NodeID forbidden_node); -} // namespace contractor } // namespace osrm #endif // OSRM_CONTRACTOR_DIJKSTRA_HPP diff --git a/include/contractor/crc32_processor.hpp b/include/contractor/crc32_processor.hpp index a441ae576..c909731ba 100644 --- a/include/contractor/crc32_processor.hpp +++ b/include/contractor/crc32_processor.hpp @@ -9,9 +9,7 @@ #include -namespace osrm -{ -namespace contractor +namespace osrm::contractor { class IteratorbasedCRC32 @@ -125,7 +123,6 @@ struct RangebasedCRC32 private: IteratorbasedCRC32 crc32; }; -} // namespace contractor } // namespace osrm #endif /* ITERATOR_BASED_CRC32_H */ diff --git a/include/contractor/files.hpp b/include/contractor/files.hpp index 39ffa5b54..6c747b6cf 100644 --- a/include/contractor/files.hpp +++ b/include/contractor/files.hpp @@ -5,11 +5,7 @@ #include -namespace osrm -{ -namespace contractor -{ -namespace files +namespace osrm::contractor::files { // reads .osrm.hsgr file template @@ -52,8 +48,6 @@ inline void writeGraph(const boost::filesystem::path &path, serialization::write(writer, "/ch/metrics/" + pair.first, pair.second); } } -} // namespace files -} // namespace contractor } // namespace osrm #endif diff --git a/include/contractor/graph_contractor.hpp b/include/contractor/graph_contractor.hpp index a6a3891c2..2df62c795 100644 --- a/include/contractor/graph_contractor.hpp +++ b/include/contractor/graph_contractor.hpp @@ -8,9 +8,7 @@ #include #include -namespace osrm -{ -namespace contractor +namespace osrm::contractor { std::vector contractGraph(ContractorGraph &graph, @@ -37,7 +35,6 @@ inline auto contractGraph(ContractorGraph &graph, graph, {}, std::move(node_is_contractable), std::move(node_weights), core_factor); } -} // namespace contractor } // namespace osrm #endif // OSRM_CONTRACTOR_GRAPH_CONTRACTOR_HPP diff --git a/include/contractor/graph_contractor_adaptors.hpp b/include/contractor/graph_contractor_adaptors.hpp index cfd447efb..a622b9048 100644 --- a/include/contractor/graph_contractor_adaptors.hpp +++ b/include/contractor/graph_contractor_adaptors.hpp @@ -10,9 +10,7 @@ #include -namespace osrm -{ -namespace contractor +namespace osrm::contractor { // Make sure to move in the input edge list! @@ -177,7 +175,6 @@ template inline std::vector toEdges(GraphT g return edges; } -} // namespace contractor } // namespace osrm #endif // OSRM_CONTRACTOR_GRAPH_CONTRACTION_ADAPTORS_HPP_ diff --git a/include/contractor/query_edge.hpp b/include/contractor/query_edge.hpp index 08f163044..f8281ac0e 100644 --- a/include/contractor/query_edge.hpp +++ b/include/contractor/query_edge.hpp @@ -5,9 +5,7 @@ #include -namespace osrm -{ -namespace contractor +namespace osrm::contractor { struct QueryEdge @@ -77,7 +75,6 @@ struct QueryEdge data.distance == right.data.distance); } }; -} // namespace contractor } // namespace osrm #endif // QUERYEDGE_HPP diff --git a/include/contractor/query_graph.hpp b/include/contractor/query_graph.hpp index c0c4b6cf5..ad7844435 100644 --- a/include/contractor/query_graph.hpp +++ b/include/contractor/query_graph.hpp @@ -6,9 +6,7 @@ #include "util/static_graph.hpp" #include "util/typedefs.hpp" -namespace osrm -{ -namespace contractor +namespace osrm::contractor { namespace detail @@ -19,7 +17,6 @@ using QueryGraph = util::StaticGraph; using QueryGraph = detail::QueryGraph; using QueryGraphView = detail::QueryGraph; -} // namespace contractor } // namespace osrm #endif // QUERYEDGE_HPP diff --git a/include/contractor/serialization.hpp b/include/contractor/serialization.hpp index 693216d6a..da9ec8bdb 100644 --- a/include/contractor/serialization.hpp +++ b/include/contractor/serialization.hpp @@ -8,11 +8,7 @@ #include "storage/serialization.hpp" #include "storage/tar.hpp" -namespace osrm -{ -namespace contractor -{ -namespace serialization +namespace osrm::contractor::serialization { template @@ -46,8 +42,6 @@ void read(storage::tar::FileReader &reader, metric.edge_filter[index]); } } -} // namespace serialization -} // namespace contractor } // namespace osrm #endif diff --git a/include/customizer/cell_customizer.hpp b/include/customizer/cell_customizer.hpp index 8a104e2e0..5cb924c89 100644 --- a/include/customizer/cell_customizer.hpp +++ b/include/customizer/cell_customizer.hpp @@ -10,9 +10,7 @@ #include -namespace osrm -{ -namespace customizer +namespace osrm::customizer { class CellCustomizer @@ -235,7 +233,6 @@ class CellCustomizer const partitioner::MultiLevelPartition &partition; }; -} // namespace customizer } // namespace osrm #endif // OSRM_CELLS_CUSTOMIZER_HPP diff --git a/include/customizer/cell_metric.hpp b/include/customizer/cell_metric.hpp index a522facc3..2adf713fb 100644 --- a/include/customizer/cell_metric.hpp +++ b/include/customizer/cell_metric.hpp @@ -7,9 +7,7 @@ #include "util/typedefs.hpp" #include "util/vector_view.hpp" -namespace osrm -{ -namespace customizer +namespace osrm::customizer { namespace detail { @@ -26,7 +24,6 @@ template struct CellMetricImpl using CellMetric = detail::CellMetricImpl; using CellMetricView = detail::CellMetricImpl; -} // namespace customizer } // namespace osrm #endif diff --git a/include/customizer/customizer.hpp b/include/customizer/customizer.hpp index a7716cf1b..40d2583f8 100644 --- a/include/customizer/customizer.hpp +++ b/include/customizer/customizer.hpp @@ -3,9 +3,7 @@ #include "customizer/customizer_config.hpp" -namespace osrm -{ -namespace customizer +namespace osrm::customizer { class Customizer @@ -14,7 +12,6 @@ class Customizer int Run(const CustomizationConfig &config); }; -} // namespace customizer } // namespace osrm #endif // OSRM_CUSTOMIZE_CUSTOMIZER_HPP diff --git a/include/customizer/customizer_config.hpp b/include/customizer/customizer_config.hpp index 4df629de5..ca5258fb2 100644 --- a/include/customizer/customizer_config.hpp +++ b/include/customizer/customizer_config.hpp @@ -9,9 +9,7 @@ #include "storage/io_config.hpp" #include "updater/updater_config.hpp" -namespace osrm -{ -namespace customizer +namespace osrm::customizer { struct CustomizationConfig final : storage::IOConfig @@ -39,7 +37,6 @@ struct CustomizationConfig final : storage::IOConfig updater::UpdaterConfig updater_config; }; -} // namespace customizer } // namespace osrm #endif // OSRM_CUSTOMIZE_CUSTOMIZER_CONFIG_HPP diff --git a/include/customizer/edge_based_graph.hpp b/include/customizer/edge_based_graph.hpp index b90f464a7..2f5a552b2 100644 --- a/include/customizer/edge_based_graph.hpp +++ b/include/customizer/edge_based_graph.hpp @@ -11,9 +11,7 @@ #include -namespace osrm -{ -namespace customizer +namespace osrm::customizer { struct EdgeBasedGraphEdgeData @@ -126,7 +124,6 @@ using MultiLevelEdgeBasedGraph = MultiLevelGraph; using MultiLevelEdgeBasedGraphView = MultiLevelGraph; -} // namespace customizer } // namespace osrm #endif diff --git a/include/customizer/files.hpp b/include/customizer/files.hpp index 335b77a30..287ca5063 100644 --- a/include/customizer/files.hpp +++ b/include/customizer/files.hpp @@ -9,11 +9,7 @@ #include -namespace osrm -{ -namespace customizer -{ -namespace files +namespace osrm::customizer::files { // reads .osrm.cell_metrics file @@ -106,8 +102,6 @@ inline void writeGraph(const boost::filesystem::path &path, writer.WriteFrom("/mld/connectivity_checksum", connectivity_checksum); serialization::write(writer, "/mld/multilevelgraph", graph); } -} // namespace files -} // namespace customizer } // namespace osrm #endif diff --git a/include/customizer/serialization.hpp b/include/customizer/serialization.hpp index c242f8ba3..158d37a39 100644 --- a/include/customizer/serialization.hpp +++ b/include/customizer/serialization.hpp @@ -9,11 +9,7 @@ #include "storage/shared_memory_ownership.hpp" #include "storage/tar.hpp" -namespace osrm -{ -namespace customizer -{ -namespace serialization +namespace osrm::customizer::serialization { template @@ -65,8 +61,6 @@ inline void write(storage::tar::FileWriter &writer, storage::serialization::write(writer, name + "/is_backward_edge", graph.is_backward_edge); storage::serialization::write(writer, name + "/node_to_edge_offset", graph.node_to_edge_offset); } -} // namespace serialization -} // namespace customizer } // namespace osrm #endif diff --git a/include/engine/algorithm.hpp b/include/engine/algorithm.hpp index 1d65cac04..eca88b21c 100644 --- a/include/engine/algorithm.hpp +++ b/include/engine/algorithm.hpp @@ -3,11 +3,7 @@ #include -namespace osrm -{ -namespace engine -{ -namespace routing_algorithms +namespace osrm::engine::routing_algorithms { // Contraction Hiearchy @@ -111,8 +107,6 @@ template <> struct HasGetTileTurns final : std::true_type template <> struct HasExcludeFlags final : std::true_type { }; -} // namespace routing_algorithms -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/api/base_api.hpp b/include/engine/api/base_api.hpp index 0cd066d0f..a1ce063f1 100644 --- a/include/engine/api/base_api.hpp +++ b/include/engine/api/base_api.hpp @@ -18,11 +18,7 @@ #include #include -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { static const constexpr char *INTERSECTION_DELIMITER = " / "; @@ -170,8 +166,6 @@ class BaseAPI const BaseParameters ¶meters; }; -} // namespace api -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/api/base_parameters.hpp b/include/engine/api/base_parameters.hpp index d5bb71a53..7e243dc98 100644 --- a/include/engine/api/base_parameters.hpp +++ b/include/engine/api/base_parameters.hpp @@ -38,11 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { /** @@ -124,8 +120,6 @@ struct BaseParameters }); } }; -} // namespace api -} // namespace engine } // namespace osrm #endif // ROUTE_PARAMETERS_HPP diff --git a/include/engine/api/base_result.hpp b/include/engine/api/base_result.hpp index 5dd63e7a9..eae87550a 100644 --- a/include/engine/api/base_result.hpp +++ b/include/engine/api/base_result.hpp @@ -8,16 +8,10 @@ #include "util/json_container.hpp" -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { using ResultT = mapbox::util::variant; -} // namespace api -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/api/flatbuffers/fbresult_generated.h b/include/engine/api/flatbuffers/fbresult_generated.h index 05211bec6..ec5690022 100644 --- a/include/engine/api/flatbuffers/fbresult_generated.h +++ b/include/engine/api/flatbuffers/fbresult_generated.h @@ -6,10 +6,7 @@ #include "flatbuffers/flatbuffers.h" -namespace osrm { -namespace engine { -namespace api { -namespace fbresult { +namespace osrm::engine::api::fbresult { struct Position; @@ -2431,9 +2428,6 @@ inline std::unique_ptr UnPackSizePrefixe return std::unique_ptr(GetSizePrefixedFBResult(buf)->UnPack(res)); } -} // namespace fbresult -} // namespace api -} // namespace engine } // namespace osrm #endif // FLATBUFFERS_GENERATED_FBRESULT_OSRM_ENGINE_API_FBRESULT_H_ diff --git a/include/engine/api/json_factory.hpp b/include/engine/api/json_factory.hpp index f92dba16a..3e3c98005 100644 --- a/include/engine/api/json_factory.hpp +++ b/include/engine/api/json_factory.hpp @@ -19,16 +19,12 @@ #include #include -namespace osrm -{ -namespace engine +namespace osrm::engine { struct Hint; -namespace api -{ -namespace json +namespace api::json { namespace detail { @@ -112,9 +108,7 @@ util::json::Object makeRouteLeg(guidance::RouteLeg leg, util::json::Array steps) util::json::Array makeRouteLegs(std::vector legs, std::vector step_geometries, std::vector annotations); -} // namespace json } // namespace api -} // namespace engine } // namespace osrm #endif // ENGINE_GUIDANCE_API_RESPONSE_GENERATOR_HPP_ diff --git a/include/engine/api/match_api.hpp b/include/engine/api/match_api.hpp index d7899817d..341f9cc3b 100644 --- a/include/engine/api/match_api.hpp +++ b/include/engine/api/match_api.hpp @@ -12,11 +12,7 @@ #include "util/integer_range.hpp" -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { class MatchAPI final : public RouteAPI @@ -253,8 +249,6 @@ class MatchAPI final : public RouteAPI const tidy::Result &tidy_result; }; -} // namespace api -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/api/match_parameters.hpp b/include/engine/api/match_parameters.hpp index 774a2c09d..e2009bd6e 100644 --- a/include/engine/api/match_parameters.hpp +++ b/include/engine/api/match_parameters.hpp @@ -32,11 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { /** @@ -98,8 +94,6 @@ struct MatchParameters : public RouteParameters (timestamps.empty() || timestamps.size() == coordinates.size()); } }; -} // namespace api -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/api/match_parameters_tidy.hpp b/include/engine/api/match_parameters_tidy.hpp index 694dd6885..43b12dd13 100644 --- a/include/engine/api/match_parameters_tidy.hpp +++ b/include/engine/api/match_parameters_tidy.hpp @@ -11,13 +11,7 @@ #include #include -namespace osrm -{ -namespace engine -{ -namespace api -{ -namespace tidy +namespace osrm::engine::api::tidy { struct Thresholds @@ -200,9 +194,6 @@ inline Result tidy(const MatchParameters ¶ms, Thresholds cfg = {15., 5}) return result; } -} // namespace tidy -} // namespace api -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/api/nearest_api.hpp b/include/engine/api/nearest_api.hpp index 43c42de29..1f031f2f5 100644 --- a/include/engine/api/nearest_api.hpp +++ b/include/engine/api/nearest_api.hpp @@ -12,11 +12,7 @@ #include -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { class NearestAPI final : public BaseAPI @@ -164,8 +160,6 @@ class NearestAPI final : public BaseAPI } }; -} // namespace api -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/api/nearest_parameters.hpp b/include/engine/api/nearest_parameters.hpp index 576e75352..d6217fcfa 100644 --- a/include/engine/api/nearest_parameters.hpp +++ b/include/engine/api/nearest_parameters.hpp @@ -30,11 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "engine/api/base_parameters.hpp" -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { /** @@ -52,8 +48,6 @@ struct NearestParameters : public BaseParameters bool IsValid() const { return BaseParameters::IsValid() && number_of_results >= 1; } }; -} // namespace api -} // namespace engine } // namespace osrm #endif // ENGINE_API_NEAREST_PARAMETERS_HPP diff --git a/include/engine/api/route_api.hpp b/include/engine/api/route_api.hpp index 044ea0b1b..a494abe64 100644 --- a/include/engine/api/route_api.hpp +++ b/include/engine/api/route_api.hpp @@ -31,11 +31,7 @@ #include #include -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { class RouteAPI : public BaseAPI @@ -1001,8 +997,6 @@ class RouteAPI : public BaseAPI } }; -} // namespace api -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/api/route_parameters.hpp b/include/engine/api/route_parameters.hpp index 8d5dd9ae4..a513daad1 100644 --- a/include/engine/api/route_parameters.hpp +++ b/include/engine/api/route_parameters.hpp @@ -32,11 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { /** @@ -211,8 +207,6 @@ inline RouteParameters::AnnotationsType operator|=(RouteParameters::AnnotationsT { return lhs = lhs | rhs; } -} // namespace api -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/api/table_api.hpp b/include/engine/api/table_api.hpp index 21dc80a28..2eaee214b 100644 --- a/include/engine/api/table_api.hpp +++ b/include/engine/api/table_api.hpp @@ -22,11 +22,7 @@ #include -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { class TableAPI final : public BaseAPI @@ -422,8 +418,6 @@ class TableAPI final : public BaseAPI const TableParameters ¶meters; }; -} // namespace api -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/api/table_parameters.hpp b/include/engine/api/table_parameters.hpp index 4d3db980e..ea860652c 100644 --- a/include/engine/api/table_parameters.hpp +++ b/include/engine/api/table_parameters.hpp @@ -36,11 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { /** @@ -166,8 +162,6 @@ inline TableParameters::AnnotationsType &operator|=(TableParameters::Annotations { return lhs = lhs | rhs; } -} // namespace api -} // namespace engine } // namespace osrm #endif // ENGINE_API_TABLE_PARAMETERS_HPP diff --git a/include/engine/api/tile_parameters.hpp b/include/engine/api/tile_parameters.hpp index e5328e7c7..2c5bafc27 100644 --- a/include/engine/api/tile_parameters.hpp +++ b/include/engine/api/tile_parameters.hpp @@ -30,11 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { /** @@ -70,8 +66,6 @@ struct TileParameters final return valid_x && valid_y && valid_z; } }; -} // namespace api -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/api/trip_api.hpp b/include/engine/api/trip_api.hpp index fb8e5598b..74e17676b 100644 --- a/include/engine/api/trip_api.hpp +++ b/include/engine/api/trip_api.hpp @@ -10,11 +10,7 @@ #include "util/integer_range.hpp" -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { class TripAPI final : public RouteAPI @@ -180,8 +176,6 @@ class TripAPI final : public RouteAPI const TripParameters ¶meters; }; -} // namespace api -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/api/trip_parameters.hpp b/include/engine/api/trip_parameters.hpp index 84d6b861a..bffcae38c 100644 --- a/include/engine/api/trip_parameters.hpp +++ b/include/engine/api/trip_parameters.hpp @@ -33,11 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -namespace osrm -{ -namespace engine -{ -namespace api +namespace osrm::engine::api { /** @@ -76,8 +72,6 @@ struct TripParameters : public RouteParameters bool IsValid() const { return RouteParameters::IsValid(); } }; -} // namespace api -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/approach.hpp b/include/engine/approach.hpp index f7d671a9c..c5ee5182a 100644 --- a/include/engine/approach.hpp +++ b/include/engine/approach.hpp @@ -30,9 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include -namespace osrm -{ -namespace engine +namespace osrm::engine { enum class Approach : std::uint8_t @@ -41,6 +39,5 @@ enum class Approach : std::uint8_t UNRESTRICTED = 1 }; -} } // namespace osrm #endif diff --git a/include/engine/bearing.hpp b/include/engine/bearing.hpp index 54e24f57f..60bfe28fe 100644 --- a/include/engine/bearing.hpp +++ b/include/engine/bearing.hpp @@ -28,9 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef OSRM_ENGINE_BEARING_HPP #define OSRM_ENGINE_BEARING_HPP -namespace osrm -{ -namespace engine +namespace osrm::engine { struct Bearing @@ -46,7 +44,6 @@ inline bool operator==(const Bearing lhs, const Bearing rhs) return lhs.bearing == rhs.bearing && lhs.range == rhs.range; } inline bool operator!=(const Bearing lhs, const Bearing rhs) { return !(lhs == rhs); } -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/data_watchdog.hpp b/include/engine/data_watchdog.hpp index 29fb93443..1e913a26b 100644 --- a/include/engine/data_watchdog.hpp +++ b/include/engine/data_watchdog.hpp @@ -17,9 +17,7 @@ #include #include -namespace osrm -{ -namespace engine +namespace osrm::engine { namespace detail @@ -149,7 +147,6 @@ class DataWatchdogImpl class FacadeT> using DataWatchdog = detail::DataWatchdogImpl>; -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/datafacade.hpp b/include/engine/datafacade.hpp index f0f8e9e5b..1488610e0 100644 --- a/include/engine/datafacade.hpp +++ b/include/engine/datafacade.hpp @@ -3,15 +3,12 @@ #include "engine/datafacade/contiguous_internalmem_datafacade.hpp" -namespace osrm -{ -namespace engine +namespace osrm::engine { using DataFacadeBase = datafacade::ContiguousInternalMemoryDataFacadeBase; template using DataFacade = datafacade::ContiguousInternalMemoryDataFacade; -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/datafacade/algorithm_datafacade.hpp b/include/engine/datafacade/algorithm_datafacade.hpp index 73c6b4732..d838f9c09 100644 --- a/include/engine/datafacade/algorithm_datafacade.hpp +++ b/include/engine/datafacade/algorithm_datafacade.hpp @@ -12,11 +12,7 @@ #include "util/filtered_graph.hpp" #include "util/integer_range.hpp" -namespace osrm -{ -namespace engine -{ -namespace datafacade +namespace osrm::engine::datafacade { // Namespace local aliases for algorithms @@ -109,8 +105,6 @@ template <> class AlgorithmDataFacade virtual EdgeID FindEdge(const NodeID edge_based_node_from, const NodeID edge_based_node_to) const = 0; }; -} // namespace datafacade -} // namespace engine } // namespace osrm #endif diff --git a/include/engine/datafacade/contiguous_block_allocator.hpp b/include/engine/datafacade/contiguous_block_allocator.hpp index 0af5b310b..5103dc8a8 100644 --- a/include/engine/datafacade/contiguous_block_allocator.hpp +++ b/include/engine/datafacade/contiguous_block_allocator.hpp @@ -3,11 +3,7 @@ #include "storage/shared_data_index.hpp" -namespace osrm -{ -namespace engine -{ -namespace datafacade +namespace osrm::engine::datafacade { class ContiguousBlockAllocator @@ -19,8 +15,6 @@ class ContiguousBlockAllocator virtual const storage::SharedDataIndex &GetIndex() = 0; }; -} // namespace datafacade -} // namespace engine } // namespace osrm #endif // OSRM_ENGINE_DATAFACADE_CONTIGUOUS_BLOCK_ALLOCATOR_HPP_ diff --git a/include/engine/datafacade/contiguous_internalmem_datafacade.hpp b/include/engine/datafacade/contiguous_internalmem_datafacade.hpp index 48d00e0c1..936c9a927 100644 --- a/include/engine/datafacade/contiguous_internalmem_datafacade.hpp +++ b/include/engine/datafacade/contiguous_internalmem_datafacade.hpp @@ -28,11 +28,7 @@ #include #include -namespace osrm -{ -namespace engine -{ -namespace datafacade +namespace osrm::engine::datafacade { template class ContiguousInternalMemoryAlgorithmDataFacade; @@ -693,8 +689,6 @@ class ContiguousInternalMemoryDataFacade final { } }; -} // namespace datafacade -} // namespace engine } // namespace osrm #endif // CONTIGUOUS_INTERNALMEM_DATAFACADE_HPP diff --git a/include/engine/datafacade/datafacade_base.hpp b/include/engine/datafacade/datafacade_base.hpp index 8ecd5946e..d38a329bf 100644 --- a/include/engine/datafacade/datafacade_base.hpp +++ b/include/engine/datafacade/datafacade_base.hpp @@ -40,11 +40,7 @@ #include #include -namespace osrm -{ -namespace engine -{ -namespace datafacade +namespace osrm::engine::datafacade { class BaseDataFacade @@ -189,8 +185,6 @@ class BaseDataFacade virtual std::vector GetOverridesThatStartAt(const NodeID edge_based_node_id) const = 0; }; -} // namespace datafacade -} // namespace engine } // namespace osrm #endif // DATAFACADE_BASE_HPP diff --git a/include/engine/datafacade/mmap_memory_allocator.hpp b/include/engine/datafacade/mmap_memory_allocator.hpp index 817fcf9db..9fae0f562 100644 --- a/include/engine/datafacade/mmap_memory_allocator.hpp +++ b/include/engine/datafacade/mmap_memory_allocator.hpp @@ -12,11 +12,7 @@ #include #include -namespace osrm -{ -namespace engine -{ -namespace datafacade +namespace osrm::engine::datafacade { /** @@ -37,8 +33,6 @@ class MMapMemoryAllocator final : public ContiguousBlockAllocator std::string rtree_filename; }; -} // namespace datafacade -} // namespace engine } // namespace osrm #endif // OSRM_ENGINE_DATAFACADE_SHARED_MEMORY_ALLOCATOR_HPP_ diff --git a/include/engine/datafacade/process_memory_allocator.hpp b/include/engine/datafacade/process_memory_allocator.hpp index 742f20e36..5851f545f 100644 --- a/include/engine/datafacade/process_memory_allocator.hpp +++ b/include/engine/datafacade/process_memory_allocator.hpp @@ -6,11 +6,7 @@ #include -namespace osrm -{ -namespace engine -{ -namespace datafacade +namespace osrm::engine::datafacade { /** @@ -34,8 +30,6 @@ class ProcessMemoryAllocator final : public ContiguousBlockAllocator std::unique_ptr internal_memory; }; -} // namespace datafacade -} // namespace engine } // namespace osrm #endif // OSRM_ENGINE_DATAFACADE_PROCESS_MEMORY_ALLOCATOR_HPP_ diff --git a/include/engine/datafacade/shared_memory_allocator.hpp b/include/engine/datafacade/shared_memory_allocator.hpp index 5b0a0989a..5326d8d37 100644 --- a/include/engine/datafacade/shared_memory_allocator.hpp +++ b/include/engine/datafacade/shared_memory_allocator.hpp @@ -8,11 +8,7 @@ #include -namespace osrm -{ -namespace engine -{ -namespace datafacade +namespace osrm::engine::datafacade { /** @@ -35,8 +31,6 @@ class SharedMemoryAllocator final : public ContiguousBlockAllocator std::vector> memory_regions; }; -} // namespace datafacade -} // namespace engine } // namespace osrm #endif // OSRM_ENGINE_DATAFACADE_SHARED_MEMORY_ALLOCATOR_HPP_ diff --git a/include/engine/datafacade_factory.hpp b/include/engine/datafacade_factory.hpp index e01c70f72..705b8ff19 100644 --- a/include/engine/datafacade_factory.hpp +++ b/include/engine/datafacade_factory.hpp @@ -16,9 +16,7 @@ #include #include -namespace osrm -{ -namespace engine +namespace osrm::engine { // This class selects the right facade for template