-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Labels
kind: bugsolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation
Milestone
Description
Description
If a type is defined with NLOHMANN_DEFINE_TYPE_INTRUSIVE
, it cannot directly be used with ordered_json
.
Reproduction steps
#include <nlohmann/json.hpp>
struct my_type_t {
std::string key;
NLOHMANN_DEFINE_TYPE_INTRUSIVE(my_type_t, key)
};
int main()
{
auto thing = my_type_t{};
nlohmann::json my_json = thing;
// doesn't compile
nlohmann::ordered_json my_ordered_json = thing;
return 0;
}
Expected vs. actual results
I would expect nlohmann::ordered_json my_ordered_json = custom_type
; to compile
Minimal code example
No response
Error messages
No response
Compiler and operating system
gcc 13.1
Library version
trunk on godbolt
Validation
- The bug also occurs if the latest version from the
develop
branch is used. - I can successfully compile and run the unit tests.
Metadata
Metadata
Assignees
Labels
kind: bugsolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation