0

How can I serialize a structure where a map is nested in a map - like the message below - using msg pack in cpp?:

{"string": "string", "string": {"string": int, "string": int, "string": int} }

eggman
  • 3
  • 3

1 Answers1

0

I think you want this:-

struct s{
std::map< std::string, std::string> m;
std::map< std::string, std::map<std::string, std::int> > l;
};
Vineet Jain
  • 1,515
  • 4
  • 21
  • 31
  • Thanks! The idea was correct. To make it work with msgpack, I needed a few changes: `struct S1 { string subject; vector>ref_data; MSGPACK_DEFINE_MAP(subject,ref_data); };` – eggman Oct 30 '17 at 12:36