Skip to content

How to serialize a union without knowing its type? #4152

Answered by nlohmann
niebayes asked this question in Q&A
Discussion options

You must be logged in to vote

If you can express this in code, you can implement this in the to_json function. I don't think this is a problem specific to this library.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@niebayes
Comment options

@nlohmann
Comment options

@niebayes
Comment options

@nlohmann
Comment options

Answer selected by niebayes
@niebayes
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants