You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/08/11 20:07:00 UTC

[2/2] mesos git commit: Added stringify for Set in stout.

Added stringify for Set in stout.


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/98fe2606
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/98fe2606
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/98fe2606

Branch: refs/heads/master
Commit: 98fe2606040e72c73240026dcababe6dc0f06b1d
Parents: 4c12c1e
Author: Jie Yu <yu...@gmail.com>
Authored: Thu Aug 11 13:03:42 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Thu Aug 11 13:06:48 2016 -0700

----------------------------------------------------------------------
 3rdparty/stout/include/stout/stringify.hpp | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/98fe2606/3rdparty/stout/include/stout/stringify.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/stringify.hpp b/3rdparty/stout/include/stout/stringify.hpp
index 6b6e788..b4d3e61 100644
--- a/3rdparty/stout/include/stout/stringify.hpp
+++ b/3rdparty/stout/include/stout/stringify.hpp
@@ -23,6 +23,7 @@
 
 #include "abort.hpp"
 #include "hashmap.hpp"
+#include "set.hpp"
 
 template <typename T>
 std::string stringify(T t)
@@ -61,6 +62,23 @@ std::string stringify(const std::set<T>& set)
 
 
 template <typename T>
+std::string stringify(const Set<T>& set)
+{
+  std::ostringstream out;
+  out << "{ ";
+  typename Set<T>::const_iterator iterator = set.begin();
+  while (iterator != set.end()) {
+    out << stringify(*iterator);
+    if (++iterator != set.end()) {
+      out << ", ";
+    }
+  }
+  out << " }";
+  return out.str();
+}
+
+
+template <typename T>
 std::string stringify(const std::list<T>& list)
 {
   std::ostringstream out;