-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
ordered_json
doesn't support construction from C array of custom type
#3810
Labels
Milestone
Comments
This will be fixed by #2843. In the meantime, this can be solved by writing |
I see, thanks! |
4 tasks
Fixed by merging #4597. |
nlohmann
added a commit
that referenced
this issue
Jan 19, 2025
Signed-off-by: Niels Lohmann <[email protected]>
nlohmann
added a commit
that referenced
this issue
Jan 22, 2025
Signed-off-by: Niels Lohmann <[email protected]>
nlohmann
added a commit
that referenced
this issue
Jan 22, 2025
Signed-off-by: Niels Lohmann <[email protected]>
nlohmann
added a commit
that referenced
this issue
Jan 23, 2025
Signed-off-by: Niels Lohmann <[email protected]>
nlohmann
added a commit
that referenced
this issue
Jan 23, 2025
Signed-off-by: Niels Lohmann <[email protected]>
nlohmann
added a commit
that referenced
this issue
Feb 15, 2025
* ✅ add regression test for #3810 Signed-off-by: Niels Lohmann <[email protected]> * ✅ add regression test for #3810 Signed-off-by: Niels Lohmann <[email protected]> * ✅ add regression test for #3810 Signed-off-by: Niels Lohmann <[email protected]> * ✅ add regression test for #3810 Signed-off-by: Niels Lohmann <[email protected]> * ✅ add regression test for #3810 Signed-off-by: Niels Lohmann <[email protected]> --------- Signed-off-by: Niels Lohmann <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Description
I have a C-style array of structs, plus an appropriate
to_json
overload. I can succesfully convert the array to JSON using a regularnlohmann::json
object. However, trying to do the same usingnlohmann::ordered_json
fails to compile - see details below.Reproduction steps
See the example code below.
Expected vs. actual results
I'd expect the code to compile, but I get a compiler error.
Minimal code example
Build with
-std=c++17 -O3
.Error messages
gcc 9.4.0 reports:
Clang outputs a significantly longer error message, which boils down to "No matching constructor found".
Compiler and operating system
GCC 9.4 on Linux (godbolt), Apple Clang 10 on Mac OS
Library version
3.11.1
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: