| 189 | }; |
| 190 | |
| 191 | void serialize (const my_example_object& item, std::ostream& out) |
| 192 | { |
| 193 | /* |
| 194 | serialize() just needs to write the state of item to the output stream. |
| 195 | You can do this however you like. Below, I'm using the serialize functions |
| 196 | for int and std::string which come with dlib. But again, you can do whatever |
| 197 | you want here. |
| 198 | */ |
| 199 | dlib::serialize(item.value, out); |
| 200 | dlib::serialize(item.str, out); |
| 201 | } |
| 202 | |
| 203 | void deserialize (my_example_object& item, std::istream& in) |
| 204 | { |