msgpack-c icon indicating copy to clipboard operation
msgpack-c copied to clipboard

Pack map or array

Open xiaoxiangdu opened this issue 11 years ago • 2 comments

Hi guy,

Another question, when I pack map or array, I must set the size of pack_map/pack_array. But I do not know the size of it when I do the pack_map/pack_array, Do there have other ways?

Best, Mack

xiaoxiangdu avatar Jan 14 '15 04:01 xiaoxiangdu

Due to msgpack format https://github.com/msgpack/msgpack/blob/master/spec.md#formats-array , you need to set size first.

When you don't know the size of them, you could use std::vector or std::map as a buffer. But I'm not sure about your usecase.

redboltz avatar Jan 14 '15 13:01 redboltz

Thank you, redboltz.

xiaoxiangdu avatar Jan 15 '15 01:01 xiaoxiangdu