10 #ifndef MSGPACK_V1_TYPE_OPTIONAL_HPP 11 #define MSGPACK_V1_TYPE_OPTIONAL_HPP 13 #if __cplusplus >= 201703 29 #if !defined (MSGPACK_USE_CPP03) 32 struct as<std::optional<T>, typename std::enable_if<msgpack::has_as<T>::value>::type> {
34 if(o.
is_nil())
return std::nullopt;
39 #endif // !defined (MSGPACK_USE_CPP03) 42 struct convert<std::optional<T> > {
44 if(o.
is_nil()) v = std::nullopt;
55 struct pack<std::optional<T> > {
56 template <
typename Stream>
65 struct object<std::optional<T> > {
73 struct object_with_zone<std::optional<T> > {
88 #endif // __cplusplus >= 201703 90 #endif // MSGPACK_V1_TYPE_OPTIONAL_HPP std::enable_if< msgpack::has_as< T >::value, T >::type as() const
Get value as T.
Definition: object.hpp:588
Definition: adaptor_base.hpp:15
void convert(T &v, msgpack::object const &o)
Definition: object.hpp:661
Definition: object.hpp:34
packer< Stream > & pack(const T &v)
Packing function template.
bool is_nil() const
Cheking nil.
Definition: object_fwd.hpp:99
Definition: object_fwd_decl.hpp:29
Definition: adaptor_base.hpp:43
void pack(msgpack::packer< Stream > &o, const T &v)
Definition: object.hpp:668
Object class that corresponding to MessagePack format object.
Definition: object_fwd.hpp:75
msgpack::type::object_type type
Definition: object_fwd.hpp:92
#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