11#ifndef MSGPACK_V1_TYPE_COMPLEX_HPP
12#define MSGPACK_V1_TYPE_COMPLEX_HPP
27#if !defined(MSGPACK_USE_CPP03)
32 if (
o.type != msgpack::type::ARRAY)
34 if (
o.via.array.size != 2)
36 return std::complex<T>(
o.via.array.ptr[0].as<
T>(),
o.via.array.ptr[1].as<
T>());
45 if(
o.type != msgpack::type::ARRAY)
47 if(
o.via.array.size != 2)
51 o.via.array.ptr[0].convert(
real);
52 o.via.array.ptr[1].convert(
imag);
61 template <
typename Stream>
73 o.type = msgpack::type::ARRAY;
The class template that supports continuous packing.
Definition pack.hpp:33
Definition object_fwd.hpp:231
Definition adaptor_base.hpp:15
std::complex< T > operator()(msgpack::object const &o) const
Definition complex.hpp:31
Definition object_fwd_decl.hpp:61
msgpack::object const & operator()(msgpack::object const &o, std::complex< T > &v) const
Definition complex.hpp:44
Definition adaptor_base.hpp:27
void operator()(msgpack::object::with_zone &o, std::complex< T > const &v) const
Definition complex.hpp:72
Definition adaptor_base.hpp:43
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, std::complex< T > const &v) const
Definition complex.hpp:62
Definition adaptor_base.hpp:32
Object class that corresponding to MessagePack format object.
Definition object_fwd.hpp:75
#define MSGPACK_ZONE_ALIGNOF(type)
Definition cpp03_zone_decl.hpp:30
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition versioning.hpp:66