jsoncons::decode how to read in a custom class as object not array #448
-
For reference this is the guide I am referencing https://danielaparker.github.io/jsoncons/ In the example it shows reading in a json file:
I need to read in:
Where reputons is just being read in as an object. So in the example it is setup such that:
When I tried to convert to just read the hiking_reputon class I get an error:
Is there a specific way I need to setup the class to read in an object instead of an array? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Just tried it, and it looks like |
Beta Was this translation helpful? Give feedback.
-
Doh! Yep that was it. Just set a blank default constructor and it works! Thanks! |
Beta Was this translation helpful? Give feedback.
Just tried it, and it looks like
hiking_reputon
requires a default constructor for that case.