-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Support unordered_map (and std containers?) with enum class as key #241
Comments
After more exploration, I found a way to do it by redefining my own type_traits, but I am wondering if there is a way to access to the name of the enum stored in
After more investigation I would need only a
instead of a
Here is the "raw" solution :
As you can see it would be usefull to have access to enum-generated struct so I can loop on each pair of enumtype-name and be generic. What do you think ? |
Currently, the jsoncons provided traits for map only support strings and integers as keys. I'll look into generalizing that. |
Okay thanks.
Thanks for your work ! |
Nice job! |
I've generalized the Enhancement is on master. |
Thanks a lot ! |
Enhancement is in v0.152.0 |
Hey,
I am trying to use your library to build a specific serialization.
Here is what I have :
So two templates for a Criterion and a Criteria.
But I specify them in a class :
I use these macros :
I defined an enum class MyCriterionType like this :
Everything works for MyCriterion. But When I try to decode MyCriteria, I have an error at compilation time :
After somme debugging, I found that it comes from the enum as key. When I replace it by int for instance, it works.
Everything is well declared and in order for jsoncons.
Should I specify my own type_traits for this case ?
The text was updated successfully, but these errors were encountered: