If you have only one, very simple class for serialization, it is not so difficult to implement a serialization function that records several members that you need to save. You do not give an example of the code that your class shows, but with several members, it should be relatively simple if there are no pointers. If you write out the number of serialized objects, followed by the data contained in them, this will probably be enough for your purposes.
If you want to implement serialization yourself, I will have an external function (perhaps familiar to your class) that handles the serialization of the Task array, instead of putting the serialization of the array in your class. What you can do is add the serialiseObject() function to your class, which serializes a single object, and then call it again from the array serialization function. This is a much cleaner design than serializing an array, also attached to the class itself.
Once you get to the C ++ serialized object, which is a little more complicated, especially with references and pointers, serialization very quickly becomes a difficult problem, and you really want to use the existing third-party mechanism, which was good testing.
However, as someone who is developing C ++ for life, I consider the addiction dependency to be a normal and not a third-party library that I would like to avoid. Boost gives you so many extra features that I consider part of "my standard library."
source share