Skip to content
Discussion options

You must be logged in to vote

Thanks for sharing this detailed report!

The issue is that Glaze v5.0.0 doesn't support auto-deduction for variants with multiple types of the same JSON category. Your variant has three array types:

std::vector<int>, std::vector<float>, std::vector<std::string>

All three serialize to JSON arrays, and in v5.0.0, Glaze couldn't distinguish between them during deserialization.

This was fixed in v5.6.1 with the addition of parsability-based variant support (#1916). With this feature, Glaze tries each variant alternative in order until one successfully parses.

Solution

Upgrade to Glaze v5.6.1 or later (v7.0.0 is current). Your code should work without any changes:

using VariantStore = std::var…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@nickpelling-ramonspace
Comment options

@stephenberry
Comment options

Answer selected by stephenberry
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