diff --git a/include/fc/io/raw.hpp b/include/fc/io/raw.hpp index 6b7bccb..24aff5e 100644 --- a/include/fc/io/raw.hpp +++ b/include/fc/io/raw.hpp @@ -170,7 +170,7 @@ namespace fc { FC_ASSERT( _max_depth > 0 ); T tmp; fc::raw::unpack( s, tmp, _max_depth - 1 ); - v = std::make_shared(tmp); + v = std::make_shared(std::move(tmp)); } FC_RETHROW_EXCEPTIONS( warn, "std::shared_ptr", ("type",fc::get_typename::name()) ) } template inline void pack( Stream& s, const unsigned_int& v, uint32_t _max_depth ) { diff --git a/include/fc/io/raw_fwd.hpp b/include/fc/io/raw_fwd.hpp index 87a9208..df80768 100644 --- a/include/fc/io/raw_fwd.hpp +++ b/include/fc/io/raw_fwd.hpp @@ -126,6 +126,16 @@ namespace fc { template inline void pack( Stream& s, const fc::array& v, uint32_t _max_depth=FC_PACK_MAX_DEPTH ); template inline void unpack( Stream& s, fc::array& v, uint32_t _max_depth=FC_PACK_MAX_DEPTH); + template inline void pack( Stream& s, const shared_ptr& v, + uint32_t _max_depth=FC_PACK_MAX_DEPTH ); + template inline void unpack( Stream& s, shared_ptr& v, + uint32_t _max_depth=FC_PACK_MAX_DEPTH ); + + template inline void pack( Stream& s, const shared_ptr& v, + uint32_t _max_depth=FC_PACK_MAX_DEPTH ); + template inline void unpack( Stream& s, shared_ptr& v, + uint32_t _max_depth=FC_PACK_MAX_DEPTH ); + template inline void pack( Stream& s, const bool& v, uint32_t _max_depth=FC_PACK_MAX_DEPTH ); template inline void unpack( Stream& s, bool& v, uint32_t _max_depth=FC_PACK_MAX_DEPTH );