10#ifndef MSGPACK_V1_TYPE_VECTOR_HPP
11#define MSGPACK_V1_TYPE_VECTOR_HPP
28#if !defined(MSGPACK_USE_CPP03)
30template <
typename T,
typename Alloc>
31struct as<std::vector<T, Alloc>,
typename std::enable_if<msgpack::has_as<T>::value>::type> {
34 std::vector<T, Alloc>
v;
35 v.reserve(
o.via.array.size);
36 if (
o.via.array.size > 0) {
40 v.push_back(
p->as<
T>());
50template <
typename T,
typename Alloc>
54 v.resize(
o.via.array.size);
55 if (
o.via.array.size > 0) {
58 typename std::vector<T, Alloc>::iterator
it =
v.begin();
69template <
typename T,
typename Alloc>
70struct pack<std::vector<T, Alloc> > {
71 template <
typename Stream>
75 for (
typename std::vector<T, Alloc>::const_iterator
it(
v.begin()),
it_end(
v.end());
83template <
typename T,
typename Alloc>
86 o.type = msgpack::type::ARRAY;
96 o.via.array.size = size;
97 typename std::vector<T, Alloc>::const_iterator
it(
v.begin());
99#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) && !defined(__clang__)
100#pragma GCC diagnostic push
101#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
104#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) && !defined(__clang__)
105#pragma GCC diagnostic pop
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
std::vector< T, Alloc > operator()(const msgpack::object &o) const
Definition vector.hpp:32
Definition object_fwd_decl.hpp:61
msgpack::object const & operator()(msgpack::object const &o, std::vector< T, Alloc > &v) const
Definition vector.hpp:52
Definition adaptor_base.hpp:27
void operator()(msgpack::object::with_zone &o, const std::vector< T, Alloc > &v) const
Definition vector.hpp:85
Definition adaptor_base.hpp:43
msgpack::packer< Stream > & operator()(msgpack::packer< Stream > &o, const std::vector< T, Alloc > &v) const
Definition vector.hpp:72
Definition adaptor_base.hpp:32
Object class that corresponding to MessagePack format object.
Definition object_fwd.hpp:75
#define MSGPACK_NULLPTR
Definition cpp_config_decl.hpp:85
#define MSGPACK_ZONE_ALIGNOF(type)
Definition cpp03_zone_decl.hpp:30
#define MSGPACK_API_VERSION_NAMESPACE(ns)
Definition versioning.hpp:66