10 #ifndef MSGPACK_V1_TYPE_OPTIONAL_HPP
11 #define MSGPACK_V1_TYPE_OPTIONAL_HPP
15 #if MSGPACK_CPP_VERSION >= 201703
31 #if !defined (MSGPACK_USE_CPP03)
34 struct as<std::optional<T>, typename std::enable_if<msgpack::has_as<T>::value>::type> {
36 if(o.
is_nil())
return std::nullopt;
44 struct convert<std::optional<T> > {
46 if(o.
is_nil()) v = std::nullopt;
57 struct pack<std::optional<T> > {
58 template <
typename Stream>
67 struct object<std::optional<T> > {
75 struct object_with_zone<std::optional<T> > {
The class template that supports continuous packing.
Definition: pack.hpp:33
packer< Stream > & pack_nil()
Packing nil.
Definition: pack.hpp:1170
packer< Stream > & pack(const T &v)
Packing function template.
@ NIL
Definition: object_fwd_decl.hpp:28
Definition: adaptor_base.hpp:15
void pack(msgpack::packer< Stream > &o, const T &v)
Definition: object.hpp:1180
void convert(T &v, msgpack::object const &o)
Definition: object.hpp:1173
Definition: adaptor_base.hpp:27
msgpack::object const & operator()(msgpack::object const &o, T &v) const
Definition: object.hpp:641
Definition: adaptor_base.hpp:43
void operator()(msgpack::object::with_zone &o, T const &v) const
Definition: object.hpp:657
Definition: adaptor_base.hpp:38
void operator()(msgpack::object &o, T const &v) const
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, T const &v) const
Definition: object.hpp:650
Definition: object.hpp:35
Object class that corresponding to MessagePack format object.
Definition: object_fwd.hpp:75
std::enable_if< msgpack::has_as< T >::value, T >::type as() const
Get value as T.
Definition: object.hpp:1121
msgpack::type::object_type type
Definition: object_fwd.hpp:92
bool is_nil() const
Cheking nil.
Definition: object_fwd.hpp:99
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition: versioning.hpp:66