From dab8f7651644f152d0624732de61d8c80f34f34b Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 22 Feb 2016 15:53:49 -0800 Subject: [PATCH] Fix compile on OS X --- include/util/json_util.hpp | 22 ---------------------- include/util/matching_debug_info.hpp | 10 +++++++++- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/include/util/json_util.hpp b/include/util/json_util.hpp index 00f450104..32a1bd7e4 100644 --- a/include/util/json_util.hpp +++ b/include/util/json_util.hpp @@ -36,28 +36,6 @@ template Array make_array(Args... args) return a; } -template Array make_array(const std::vector &vector) -{ - Array a; - for (const auto &v : vector) - { - a.values.emplace_back(v); - } - return a; -} - -//// template specialization needed as clang does not play nice -//// FIXME this now causes compile errors on g++ -_- -//template <> Array make_array(const std::vector &vector) -//{ -// Array a; -// for (const bool v : vector) -// { -// a.values.emplace_back(v); -// } -// return a; -//} - // Easy acces to object hierachies inline Value &get(Value &value) { return value; } diff --git a/include/util/matching_debug_info.hpp b/include/util/matching_debug_info.hpp index 4b782b768..cdd3651b4 100644 --- a/include/util/matching_debug_info.hpp +++ b/include/util/matching_debug_info.hpp @@ -120,7 +120,15 @@ struct MatchingDebugInfo return; } - json::get(*object, "breakage") = json::make_array(breakage); + // convert std::vector to osrm::json::Array + json::Array a; + for (const bool v : breakage) + { + if (v) a.values.emplace_back(json::True()); + else a.values.emplace_back(json::False()); + } + + json::get(*object, "breakage") = std::move(a); } const json::Logger *logger;