diff --git a/include/extractor/node_id.hpp b/include/extractor/node_id.hpp deleted file mode 100644 index faaefb2ef..000000000 --- a/include/extractor/node_id.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef NODE_ID_HPP -#define NODE_ID_HPP - -#include "util/typedefs.hpp" - -namespace osrm -{ -namespace extractor -{ - -struct Cmp -{ - using value_type = OSMNodeID; - bool operator()(const value_type left, const value_type right) const { return left < right; } - value_type max_value() { return MAX_OSM_NODEID; } - value_type min_value() { return MIN_OSM_NODEID; } -}; -} -} - -#endif // NODE_ID_HPP diff --git a/src/extractor/extraction_containers.cpp b/src/extractor/extraction_containers.cpp index 299d35f24..26f8d7eb8 100644 --- a/src/extractor/extraction_containers.cpp +++ b/src/extractor/extraction_containers.cpp @@ -2,7 +2,6 @@ #include "extractor/extraction_way.hpp" #include "util/coordinate_calculation.hpp" -#include "extractor/node_id.hpp" #include "util/range_table.hpp" #include "util/osrm_exception.hpp" @@ -24,6 +23,19 @@ #include #include +namespace +{ +// Needed for STXXL comparison - STXXL requires max_value(), min_value(), so we can not use +// std::less{}. Anonymous namespace to keep translation unit local. +struct OSMNodeIDSTXXLLess +{ + using value_type = OSMNodeID; + bool operator()(const value_type left, const value_type right) const { return left < right; } + value_type max_value() { return MAX_OSM_NODEID; } + value_type min_value() { return MIN_OSM_NODEID; } +}; +} + namespace osrm { namespace extractor @@ -136,7 +148,8 @@ void ExtractionContainers::PrepareNodes() { std::cout << "[extractor] Sorting used nodes ... " << std::flush; TIMER_START(sorting_used_nodes); - stxxl::sort(used_node_id_list.begin(), used_node_id_list.end(), Cmp(), stxxl_memory); + stxxl::sort(used_node_id_list.begin(), used_node_id_list.end(), OSMNodeIDSTXXLLess(), + stxxl_memory); TIMER_STOP(sorting_used_nodes); std::cout << "ok, after " << TIMER_SEC(sorting_used_nodes) << "s" << std::endl;