Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to to_json my struct ? #581

Open
DexterMagnific opened this issue Sep 21, 2021 · 0 comments
Open

Question: How to to_json my struct ? #581

DexterMagnific opened this issue Sep 21, 2021 · 0 comments

Comments

@DexterMagnific
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant