-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Compilation error with strong typed enums in map in combination with namespaces #1079
Comments
I dug up a bit, and since there is no Thus, it simply iterates on each object, and tries to construct I think the library should support As for why the heck does it compile when you put the Since |
This overload is chosen only when BasicJsonType::string_t is not constructible from std::map::key_type. Currently, converting a map to json treats it as an array of pairs. fixes nlohmann#1079
This overload is chosen only when BasicJsonType::string_t is not constructible from std::map::key_type. Currently, converting a map to json treats it as an array of pairs. fixes nlohmann#1079
This overload is chosen only when BasicJsonType::string_t is not constructible from std::map::key_type. Currently, converting a map to json treats it as an array of pairs. fixes nlohmann#1079
This overload is chosen only when BasicJsonType::string_t is not constructible from std::map::key_type. Currently, converting a map to json treats it as an array of pairs. fixes nlohmann#1079
This overload is chosen only when BasicJsonType::string_t is not constructible from std::map::key_type. Currently, converting a map to json treats it as an array of pairs. fixes nlohmann#1079
What is the issue you have?
Compilation error.
Please describe the steps to reproduce the issue. Can you provide a small but working code example?
Compiling the small program below results in C2166: l-value specifies const object (see full compiler output below). When putting the map and the to/from_json in the same namespace it compiles. It boilds down to an assignment/construction of the map's value type.
What is the expected behavior?
It should compile without errors
And what is the actual behavior instead?
Compilation errors
Which compiler and operating system are you using? Is it a supported compiler?
MSVC 2017 (15.6.6); MSVC 19.0.24215.1 (CMake output)
Not directly supported.
Did you use a released version of the library or the version from the
develop
branch?Release 3.1.2
If you experience a compilation error: can you compile and run the unit tests?
Tried but ctest gives error
Test not available without configuration. (Missing "-C <config>"?)
for every test case. If told how to fix this I'll happily execute the tests.The text was updated successfully, but these errors were encountered: