-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Labels
solution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation
Description
This is considered ambiguous and a compile time error:
#include "json.hpp"
#include <iostream>
#include <unordered_map>
using json = nlohmann::json;
int main()
{
std::cerr << "foo";
try {
auto j = json::parse(R"(
{ "m": {"one": int}}
)");
using T = std::unordered_map<std::string, std::unordered_map<std::string, int>>;
auto m = j.at("m").get<T>();
}
catch (...) {}
return 0;
}The error is a bit long but I can paste it here if desired. I don't see why this is ambiguous, seems like given the input and the types I specified there is only one possible output. Is this considered a bug? Either way, is there a workaround?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
solution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation