Skip to content

Instantly share code, notes, and snippets.

@unnonouno
Created January 7, 2014 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unnonouno/8296733 to your computer and use it in GitHub Desktop.
Save unnonouno/8296733 to your computer and use it in GitHub Desktop.
msgpack
#include <iostream>
#include <msgpack.hpp>
struct T {
int a;
MSGPACK_DEFINE(a);
};
struct S {
int a;
int b;
MSGPACK_DEFINE(a, b);
};
int main() {
T t;
t.a = 100;
msgpack::zone zone;
msgpack::object obj(t, &zone);
std::cout << obj << std::endl;
S s;
obj.convert(&s);
std::cout << s.a << " " << s.b << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment