I'm working on a body of code which deals with a custom String implementation rather than the std::string (long story but for various reasons this has to be used) which I will refer to as "String" from here on.
I was able to easily pack the String without issue using the "raw" type to pack the raw char bytes and the size but I'm having problems unpacking it.
I was able to manually unpack it as shown below.
// before this I've unpacked to the point where the following object has the string
msgpack::object_kv& kv = obj.via.map.ptr[0];
// kv.key == the String I want
String key = String(key.via.raw.ptr, key.via.raw.size); // this works
But I want to use the built in >> operator or the .as template function and haven't been able to manage it. I don't have access to modify the String class to add the msgpack_unpack function nor to add MSGPACK_DEFINE
I tried creating a struct and giving it a msgpack_unpack function, but apparently it calls it with msgpack::object::implicit_type which my compiler replies with
error: 'struct msgpack::object::implicit_type' is private
And then I can't figure out any way of getting the msgpack::object out of the "implicit_type" object.
Any ideas?