In the question Deserializing a heterogeneous map with MessagePack in C++ an answer refers to a gist which contains an example of based on recursive boost::variant
with msgpack. I am trying to replicate this with the latest msgpack-c library version (1.3.0) and getting a number of errors at compilation time. Some of these are related to changes in types in the API (msgpack types DOUBLE and RAW no longer present), others seem more fundamental:
In file included from msgpack-c/include/msgpack.hpp:10:0,
from variant.cpp:2:
msgpack-c/include/msgpack/object.hpp: In instantiation of ‘const msgpack::v1::object& msgpack::v1::adaptor::convert<T, Enabler>::operator()(const
<... lengthy output snipped for clarity ...>
msgpack::v1::object&, T&) const [with T = boost::detail::variant::void_>’ has no member named ‘msgpack_unpack’
v.msgpack_unpack(o.convert());
and similar messages about no member named msgpack_pack
.
Is there an updated gist or example of this that i compatible with the latest msgpack-c version?
I am compiling on a CentOS7 machine with gcc version 4.8.5, boost 1.58, msgpack-c included as header-only, using the following command:
g++ --std=c++11 -Imsgpack-c/include -o variant variant.cpp