From 38f6a6e10e9bb799ebb725ce4592ec8c969f56c7 Mon Sep 17 00:00:00 2001 From: vng Date: Wed, 20 Jan 2016 18:57:58 +0300 Subject: [PATCH] Added DebugPrint for unordered_map/set. --- base/internal/message.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/base/internal/message.hpp b/base/internal/message.hpp index d75096c62d..a378fdce11 100644 --- a/base/internal/message.hpp +++ b/base/internal/message.hpp @@ -9,6 +9,8 @@ #include "std/sstream.hpp" #include "std/string.hpp" #include "std/unique_ptr.hpp" +#include "std/unordered_map.hpp" +#include "std/unordered_set.hpp" #include "std/utility.hpp" #include "std/vector.hpp" @@ -28,6 +30,11 @@ template > inline string DebugPrint(set c template > inline string DebugPrint(map const & v); template inline string DebugPrint(initializer_list const & v); template inline string DebugPrint(unique_ptr const & v); + +template , class Pred = equal_to> +inline string DebugPrint(unordered_set const & v); +template , class Pred = equal_to> +inline string DebugPrint(unordered_map const & v); //@} @@ -112,6 +119,18 @@ template inline string DebugPrint(initializer_list const & v) return ::my::impl::DebugPrintSequence(v.begin(), v.end()); } +template +inline string DebugPrint(unordered_set const & v) +{ + return ::my::impl::DebugPrintSequence(v.begin(), v.end()); +} + +template +inline string DebugPrint(unordered_map const & v) +{ + return ::my::impl::DebugPrintSequence(v.begin(), v.end()); +} + template inline string DebugPrint(T const & t) { ostringstream out;