Skip to content

Deserializing std::map #1100

@RolandasV

Description

@RolandasV
  • What is the issue you have?
    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.

  • Please describe the steps to reproduce the issue. Can you provide a small but working code example?
    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.

Metadata

Metadata

Assignees

Labels

solution: proposed fixa fix for the issue has been proposed and waits for confirmation

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions