C ++ Boost.serialization vs simple loading / saving

I am a computer scientist who works with a lot of modeling data, and often I find that I save / load data to / from disk. For simple tasks such as a vector, it is usually as simple as dumping a bunch of numbers into a file and what it is.

For more complex things, objects of life, etc., I have save / load functions. Now I am not a computer scientist, and therefore often I see terms here on SO that I just don’t understand (but I love). One of them, which I have encountered recently, is the subject of serialization and the Boost.Serialization library.

From what I understand, serialization is just the process of converting your objects into something that can be saved / loaded from dist or transferred over the network and the like. Given that I most need to save / load my objects to / from the disk, is there any reason why I should switch from simple load / save functions to Boost.Serialization ? What would Boost.Serialization give me, besides what I'm already doing?

+8
c ++ boost serialization
source share
1 answer

This library takes into account many details that may not be very obvious from a purely "applicative" point of view.

For example, WRT data portability large / small numeric endianess, time-stamped data storage time, structured containers, version control, non-intrusive extensions, and more . Moreover, it correctly manages the interaction with another std or boosting infrastructure and dictates a way to structure the code that will reward you for simplifying the maintenance of the code. You will find ready-to-use serializers for many (all std and boost containers?).

And think about whether you need to share your data with someone else, it is likely that referring to a published, supported and debugging scheme will simplify the situation.

+10
source share

All Articles