Binary Serialization using Cereal

A detailed and practical tutorial for binary serialization in modern C++ using the cereal library.

Ryan McCombe
Updated
Hello! I'm here to help you with any questions about this lesson. Feel free to ask me anything - whether it's about specific concepts, examples, or how to apply what you've learned!

Questions & Answers

Answers are generated by AI models and may not have been reviewed. Be mindful when running any code on your device.

Serializing Vectors of Custom Types
How can I serialize a vector of my custom Player objects using cereal?
Serializing Maps of Polymorphic Objects
I have a std::map where the value type is a pointer to the base Character class, but it actually points to derived Monster objects. How can I serialize and deserialize this map correctly?
Versioning Serialized Game Save Files
I'm working on a game and want to ensure that save files from older versions can still be loaded in newer versions. How can I handle this using cereal's versioning features?
Serializing Private Class Members with Cereal
I want to serialize private member variables of my Player class using cereal. How can I accomplish this?
Serializing Non-Default-Constructible Classes with Cereal
I have a Weapon class that requires parameters in its constructor and doesn't have a default constructor. How can I serialize and deserialize objects of this class using cereal?
Serializing Enum Classes with Cereal
I have an enum class called State in my game. How can I serialize and deserialize variables of this enum class type using cereal?