-
-
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
Hello,
I want to serialize a list which contains a class objects. How can I do that using json. For a list of regular types I understand, but when I try to use json j_list(listName), and the listName is a list of objects I receive some errors from to_json method and 'force_msvc_stacktrace'.
This is the code.
std::list<Student>studentList;
// populate studentList with objects of Student class
string filename = "StudentList.json";
std::ofstream output(filename, std::ofstream::out);
json js_list(studentList);
output << js_list;
output.close();
What should I do to I make this work?
Thank you! :D
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