Open dcorbeil opened 3 months ago
You are right...the reason this is happening is because msgpack and cbor require you to set the size of the object in advance, which makes it difficult, but not impossible to do this.
I think I could change it, and at the very least the behaviour should be documented.
[...] because msgpack and cbor require you to set the size of the object in advance
Is this related to the expectation that maps are of finite length? This issue might not be the right place to talk about this but I was curious as to what the reason is behind that decision.
I think I could change it
That would be awesome if you did :)
The cbor implementation doesn't seem to be handling
std::optional
as documented (for json at least). Consider the following struct example:Reading
Writing
Just like for
rfl::json
, I expectedrfl::cbor::read()
to successfully parse a buffer of bytes that doesn't containstd::optional
fields leaving the missing optionals asstd::nullopt
. I also expectedrfl::cbor::write()
to not emitstd::optional
fields in the buffer of bytes.Long story short, would it be possible for
rfl::cbor
to behave likerfl::json
when it comes tostd::optional
?Thanks!