From 532093bda58427d6d14e36ea5e1a9a9ac8db784c Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Sun, 7 Apr 2019 22:31:37 +0200 Subject: [PATCH] Added missing serialization for std::shared_ptr --- include/fc/io/raw.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/fc/io/raw.hpp b/include/fc/io/raw.hpp index 5b3bfc6..27b376f 100644 --- a/include/fc/io/raw.hpp +++ b/include/fc/io/raw.hpp @@ -151,6 +151,13 @@ namespace fc { s.read( (char*)&v.data[0], N ); } FC_RETHROW_EXCEPTIONS( warn, "fc::array", ("length",N) ) } + template + inline void pack( Stream& s, const std::shared_ptr& v, uint32_t _max_depth ) + { + FC_ASSERT( _max_depth > 0 ); + fc::raw::pack( s, *v, _max_depth - 1 ); + } + template inline void unpack( Stream& s, std::shared_ptr& v, uint32_t _max_depth ) { try {