From 94bfc67708e8877f919ce64a47cf05fde6b06827 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Thu, 17 Dec 2015 15:31:16 -0500
Subject: [PATCH] value: add non-static unpack<T>()

---
 include/opendht/value.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/opendht/value.h b/include/opendht/value.h
index 9df6edeb..4be12f17 100644
--- a/include/opendht/value.h
+++ b/include/opendht/value.h
@@ -221,6 +221,12 @@ struct Value
         return unpackMsg<T>(v.data);
     }
 
+    template <typename T>
+    T unpack()
+    {
+        return unpack<T>(*this);
+    }
+
     bool isEncrypted() const {
         return not cypher.empty();
     }
@@ -261,6 +267,9 @@ struct Value
     Value(const Type& vs)
      : Value(pack<Type>(vs)) {}
 
+    /**
+     * Unpack a serialized value
+     */
     Value(const msgpack::object& o) {
         msgpack_unpack(o);
     }
-- 
GitLab