From 1e49e8b713f996a54f152a478d55ae73217a2f9d Mon Sep 17 00:00:00 2001
From: Danilo Piparo <danilo.piparo@cern.ch>
Date: Tue, 30 Apr 2019 17:38:50 +0200
Subject: [PATCH] [Cling] Add printer for std::weak_ptr

---
 .../cling/include/cling/Interpreter/RuntimePrintValue.h    | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/interpreter/cling/include/cling/Interpreter/RuntimePrintValue.h b/interpreter/cling/include/cling/Interpreter/RuntimePrintValue.h
index f40fbbfb060..eeba44a2ae6 100644
--- a/interpreter/cling/include/cling/Interpreter/RuntimePrintValue.h
+++ b/interpreter/cling/include/cling/Interpreter/RuntimePrintValue.h
@@ -296,6 +296,13 @@ namespace cling {
      return "std::shared_ptr -> " + printValue(val->get());
   }
 
+  // weak_ptr<T>:
+  template <class T>
+  inline std::string printValue(std::weak_ptr<T> *val)
+  {
+     return "std::weak_ptr -> " + printValue(val->lock().get());
+  }
+
 }
 
 #endif
-- 
GitLab