11 #ifndef MSGPACK_V1_TYPE_CPP11_SHARED_PTR_HPP 12 #define MSGPACK_V1_TYPE_CPP11_SHARED_PTR_HPP 29 struct as<std::shared_ptr<T>, typename std::enable_if<msgpack::has_as<T>::value>::type> {
31 if(o.
is_nil())
return nullptr;
32 return std::make_shared<T>(o.
as<T>());
41 v = std::make_shared<T>();
49 struct pack<std::shared_ptr<T>> {
50 template <
typename Stream>
82 #endif // MSGPACK_V1_TYPE_CPP11_SHARED_PTR_HPP bool is_nil() const
Cheking nil.
Definition: object_fwd.hpp:98
msgpack::object const & operator()(msgpack::object const &o, std::shared_ptr< T > &v) const
Definition: shared_ptr.hpp:38
void operator()(msgpack::object::with_zone &o, const std::shared_ptr< T > &v) const
Definition: shared_ptr.hpp:68
Definition: object_fwd_decl.hpp:60
Definition: adaptor_base.hpp:15
Definition: object.hpp:34
packer< Stream > & pack(const T &v)
Packing function template.
Definition: object_fwd_decl.hpp:29
std::enable_if< msgpack::has_as< T >::value, T >::type as() const
Get value as T.
Definition: object.hpp:584
Definition: adaptor_base.hpp:43
std::shared_ptr< T > operator()(msgpack::object const &o) const
Definition: shared_ptr.hpp:30
void operator()(msgpack::object &o, const std::shared_ptr< T > &v) const
Definition: shared_ptr.hpp:60
Definition: adaptor_base.hpp:32
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const std::shared_ptr< T > &v) const
Definition: shared_ptr.hpp:51
Object class that corresponding to MessagePack format object.
Definition: object_fwd.hpp:75
msgpack::type::object_type type
Definition: object_fwd.hpp:91
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:58
Definition: adaptor_base.hpp:38
The class template that supports continuous packing.
Definition: adaptor_base_decl.hpp:24
packer< Stream > & pack_nil()
Packing nil.
Definition: pack.hpp:1135
Definition: adaptor_base.hpp:27