ChaiScript
ChaiScript copied to clipboard
Question: How to to_json my struct ?
Hi,
I came across this fantastic piece of work and it's amazing. Was searching for something like this for a while. Congrats !
I'd like to ask: how to get a JSON string for my struct without going through the script eval() ?
I see that json_wrap::to_json() takes a boxed value (so a value returned from a script).
- How can I manage to get a boxed value from a C++ value (custom struct) directly ?
- Do I have to register my custom struct type to Chai first ?
Thanks.