-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Deserializing std::map #1100
Comments
There is an open PR to provide this feature: #1089 Could you try this commit and tell me if it fixes your issue? |
@nlohmann: since I need this feature, I am wondering if the develop branch is reliable to use it (unless 3.1.3 is coming). |
I hope to release 3.1.3 before the end of July. |
If one of the map pairs (e.g., |
@nlohmann do you prefer that I move the described issue in a stand-alone ticket? |
Yes, please. |
When trying to deserialize a std::map which has a int/Enum as a key I'm getting compilation error.
Error C2166 l-value specifies const object
When i try to deserialize a std::map with a key as a string for example, it compiles fine.
Serialize a std::map having int/enum as a key. Try to deserialize it.
json.at(_materialTypeByFaceSelectionJson).get<map<MaterialTypeEnum, FaceSelectionEnum>>();
What is the expected behavior?
It should compile.
And what is the actual behavior instead?
It doesn't.
Which compiler and operating system are you using? Is it a supported compiler?
I'm using windows 10 and Visual Studio 2017.
Did you use a released version of the library or the version from the
develop
branch?I'm using released version.
The text was updated successfully, but these errors were encountered: