10#ifndef MSGPACK_V1_TYPE_CPP11_TUPLE_HPP
11#define MSGPACK_V1_TYPE_CPP11_TUPLE_HPP
28template <
typename Stream,
typename Tuple, std::
size_t N>
34 o.pack(std::get<N-1>(
v));
38template <
typename Stream,
typename Tuple>
48template <
typename... Args>
49struct pack<std::tuple<Args...>> {
50 template <
typename Stream>
53 const std::tuple<Args...>&
v)
const {
65template <
typename...
Args>
68template <
typename T,
typename...
Args>
71 return std::tuple_cat(
72 std::make_tuple(
o.via.array.ptr[
o.via.array.size -
sizeof...(Args) - 1].as<
T>()),
77template <
typename...
Args>
87 return std::tuple<>();
91template <
typename Tuple, std::
size_t N>
97 if (
o.via.array.size >=
N)
98 o.via.array.ptr[
N-1].convert<
typename std::remove_reference<
decltype(std::get<
N-1>(
v))>::type>(std::get<
N-1>(
v));
102template <
typename Tuple>
112template <
typename... Args>
113struct as<std::tuple<Args...>,
typename std::enable_if<msgpack::any_of<msgpack::has_as, Args...>::value>::type> {
121template <
typename... Args>
125 std::tuple<Args...>&
v)
const {
135template <
typename Tuple, std::
size_t N>
145template <
typename Tuple>
155template <
typename... Args>
159 std::tuple<Args...>
const&
v)
const {
161 o.type = msgpack::type::ARRAY;
163 o.via.array.size = size;
The class template that supports continuous packing.
Definition pack.hpp:33
Definition object_fwd.hpp:231
Definition adaptor_base.hpp:15
uint32_t checked_get_container_size(T size)
Definition check_container_size.hpp:55
void convert(T &v, msgpack::object const &o)
Definition object.hpp:1178
static std::tuple as(msgpack::object const &)
Definition tuple.hpp:86
static std::tuple< Args... > as(msgpack::object const &o)
Definition tuple.hpp:79
static std::tuple< T, Args... > as(msgpack::object const &o)
Definition tuple.hpp:70
static void convert(msgpack::object const &, Tuple &)
Definition tuple.hpp:104
static void convert(msgpack::object const &o, Tuple &v)
Definition tuple.hpp:93
static void pack(msgpack::packer< Stream > &, const Tuple &)
Definition tuple.hpp:40
static void pack(msgpack::packer< Stream > &o, const Tuple &v)
Definition tuple.hpp:30
static void convert(msgpack::object::with_zone &, const Tuple &)
Definition tuple.hpp:147
static void convert(msgpack::object::with_zone &o, const Tuple &v)
Definition tuple.hpp:137
std::tuple< Args... > operator()(msgpack::object const &o) const
Definition tuple.hpp:114
Definition object_fwd_decl.hpp:61
msgpack::object const & operator()(msgpack::object const &o, std::tuple< Args... > &v) const
Definition tuple.hpp:123
Definition adaptor_base.hpp:27
void operator()(msgpack::object::with_zone &o, std::tuple< Args... > const &v) const
Definition tuple.hpp:157
Definition adaptor_base.hpp:43
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const std::tuple< Args... > &v) const
Definition tuple.hpp:51
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