Closed
Description
I'm trying to have a struct which can old json type as one of it's properties and it throws an error, for some reason.
namespace DataSerialization
{
struct GeneralResponse
{
int op;
json d;
};
void from_json(const json& j, const GeneralResponse& response)
{
j.at("op").get_to(response.op);
// ERROR HERE
j.at("d").get_to(response.d);
}
void to_json(json& j, const GeneralResponse& response)
{
j = json{ {"op", response.op}, {"d", response.d} };
}
}