Commit 86b08ec9 authored by Sebastian Wolf's avatar Sebastian Wolf

Fixed M map stream operator

parent 42670dc5
Pipeline #1423 passed with stages
in 17 minutes and 44 seconds
......@@ -86,11 +86,11 @@ namespace xerus { namespace misc {
///@brief Allow to pipe std::maps to ostreams.
template<class T, class U>
std::ostream& operator<<(std::ostream& _out, const std::map<T,U>& _set) {
if(_set.size() == 0) { _out << "{ }"; return _out; }
template<class T, class U, class... rest_t>
std::ostream& operator<<(std::ostream& _out, const std::map<T, U, rest_t...>& _map) {
if(_map.size() == 0) { _out << "{ }"; return _out; }
_out << "{ ";
for(const auto& item : _set) { _out << "(" << item.first << ", " << item.second << "), "; }
for(const auto& item : _map) { _out << "(" << item.first << ", " << item.second << "), "; }
_out << "\b\b }";
return _out;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment