-
-
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
patch_inplace
has several instances of get<std::string>
, which breaks the build if you're using a custom string.
Reproduction steps
- Instantiate a nlohmann::basic_json<> with a custom string type
- Attempt to call nlohmann:basic_json<>::patch
Expected vs. actual results
Compilation fails.
Minimal code example
struct MyString; // some compatible impl
using Value = nlohmann::basic_json<
std::map,
std::vector,
MyString,
bool,
std::int64_t,
std::uint64_t,
double,
std::allocator,
nlohmann::adl_serializer,
std::vector<std::uint8_t>
>;
Value base, patch;
base.patch(patch);
Error messages
No matching constructor for initialization of 'nlohmann::basic_json<std::map, std::vector, MyString >::json_pointer' (aka 'json_pointer< MyString >')
Compiler and operating system
Apple clang version 14.0.3 (clang-1403.0.22.14.1), macOS Ventura 13.5.1
Library version
3.11.2
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