diff --git a/include/contractor/files.hpp b/include/contractor/files.hpp index fc52b3492..55eba978c 100644 --- a/include/contractor/files.hpp +++ b/include/contractor/files.hpp @@ -15,11 +15,13 @@ namespace files { // reads .osrm.hsgr file -template -inline void readGraph(const boost::filesystem::path &path, - unsigned &checksum, - detail::QueryGraph &graph) +template +inline void readGraph(const boost::filesystem::path &path, unsigned &checksum, QueryGraphT &graph) { + static_assert(std::is_same::value || + std::is_same::value, + "graph must be of type QueryGraph<>"); + const auto fingerprint = storage::io::FileReader::VerifyFingerprint; storage::io::FileReader reader{path, fingerprint}; @@ -28,18 +30,19 @@ inline void readGraph(const boost::filesystem::path &path, } // writes .osrm.hsgr file -template -inline void writeGraph(const boost::filesystem::path &path, - unsigned checksum, - const detail::QueryGraph &graph) +template +inline void +writeGraph(const boost::filesystem::path &path, unsigned checksum, const QueryGraphT &graph) { + static_assert(std::is_same::value || + std::is_same::value, + "graph must be of type QueryGraph<>"); const auto fingerprint = storage::io::FileWriter::GenerateFingerprint; storage::io::FileWriter writer{path, fingerprint}; writer.WriteOne(checksum); util::serialization::write(writer, graph); } - } } }