msgpack / msgpack-c

MessagePack implementation for C and C++ / msgpack.org[C/C++]
Other
3.03k stars 883 forks source link

someting about msgpack::object.convert() #1115

Closed luanhaixin closed 7 months ago

luanhaixin commented 7 months ago
vector<int> onm ;
msgpack_object.convert( onm );

I wonder that the behavior of the method convert() is either copy the data from msgpack object in memory to my target data(onm) or directly access the msgpack object data using pointer or reference.

Because I want to manage memory and haven't seen a detailed discussion on the convert method in the wiki.

redboltz commented 7 months ago

At first, onm is empty vector. After you call convert, onm would have members corresponding to msgpack_objecft. The values are copied.