Messagepack-c library, c++ seeing error
#include<msgpack.hpp>
int main(){
struct item {
std::time_t currentTime;
std::map<std::string, std::string> base;
};
struct obj {
std::string eventName;
item item1;
std::map<std::string, std::string> dateTime;
};
obj obj1[1];
obj1[0].eventName = "TEMP_EVENT";
obj1[0].item1.base["Id"] = "6ba1ce80";
obj1[0].dateTime["TimeFormat"] = "DateTime";
std::stringstream buffer;
msgpack: pack(buffer, obj1);// this line is throwing the error
return 0;
}
I am seeing the following error.. doesn't the message pack library support array of struct?..should i use a vector here instead? I am referring to this...
msgpack/spec.md at master * msgpack/msgpack * GitHub
left of '.msgpack_pack' must have class/struct/union
~\packages\msgpack-c.0.5.9.1\build\native\include\msgpack\object.hpp( 192):
note: type is 'const obj [1]'
~\packages\msgpack-c.0.5.9.1\build\native\include\msgpack\object.hpp( 155):
note: while compiling class template member function
'msgpack::v1::packer<Stream>
&msgpack::v1::detail::packer_serializer<Stream,T>: :pack(msgpack::v1::packer<Stream>
&,const T (&))'
with
[
Stream=std::stringstream,
T=obj [1]
]