Fix compile on OS X
This commit is contained in:
		
							parent
							
								
									3f81f6b441
								
							
						
					
					
						commit
						6cf19ac4cf
					
				| @ -36,28 +36,6 @@ template <typename... Args> Array make_array(Args... args) | |||||||
|     return a; |     return a; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| template <typename T> Array make_array(const std::vector<T> &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<bool> &vector)
 |  | ||||||
| //{
 |  | ||||||
| //    Array a;
 |  | ||||||
| //    for (const bool v : vector)
 |  | ||||||
| //    {
 |  | ||||||
| //        a.values.emplace_back(v);
 |  | ||||||
| //    }
 |  | ||||||
| //    return a;
 |  | ||||||
| //}
 |  | ||||||
| 
 |  | ||||||
| // Easy acces to object hierachies
 | // Easy acces to object hierachies
 | ||||||
| inline Value &get(Value &value) { return value; } | inline Value &get(Value &value) { return value; } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -120,7 +120,15 @@ struct MatchingDebugInfo | |||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         json::get(*object, "breakage") = json::make_array(breakage); |         // convert std::vector<bool> 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; |     const json::Logger *logger; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user