How to convert STL Vector (of user defined type) to Json #2072
Labels
kind: question
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
Here is what I am trying to do,
using json = nlohmann::json;
typedef struct xyz {
int array[1024];
} xyz_t;
int main()
{
vector<vector<vector<xyz_t>>> abc;
/*......
Assume abc is filled here
...... */
json j;
json["data"]["values"] = abc; /* This gives 'error: no match for ‘operator=’ */
/* How do overload =operator in above case or is there any better way to acheive same? */
return 0;
}
The text was updated successfully, but these errors were encountered: