for c++ project use c++ msgpack library available in ubuntu (14.04) standard repository under name libmsgpack-dev. all works fine except when try pack bools. there things go absolutely bananas. first wrote simple test study pack method. turned out, can not trusted packing bools. here simple test showing problem: #include <msgpack.hpp> test_case("bool packing", "[msgpack1]") { msgpack::sbuffer buf; msgpack::packer<msgpack::sbuffer> p(&buf); std::string key = "boolvalue"; bool value = true; p.pack_map(1); { p.pack(key); p.pack(value); } msgpack::unpacked msg; msgpack::unpack(&msg, buf.data(), buf.size()); std::map<std::string, msgpack::object> m; msg.get().convert(&m); bool loaded_value; m.at(key).convert(&loaded_value); info("we packed: " << value); info("we loaded: " << loaded_value); r...
Comments
Post a Comment