4.2 Implementation

New cereal\_fwd library was based on cereal as it already provides some of the required features, and thanks to relying on C++11 language features, it has much simpler implementation than popular Boost.Serialization. It might be troublesome for some users, as it requires code to be C++11 compliant, but it helps keep library code simple, and transition towards C++11 should be desired by most existing code's maintainers anyway.

Users of both cereal and cereal\_fwd are required to explicitly list serializable structure's fields in a dedicated method, as shown in Figure 9. This is a similar solution to the Boost.Serialization, as as of the moment C++ lacks any reflection support, which could help automate the process. Ongoing work [17] suggests that in the future such code could be significantly simplified.

Figure 10 shows how structure can be serialized using selected archive type. In the example BinaryArchive is used; cereal provides few more archive types, each with the same interface—choosing different archives does not require any changes on structure side. One of the existing archives—PortableBinary—provides support for platform portability and was used as a starting point for cereal\_fwd extension in the form of the ExtendableBinary archive. The new archive type is responsible for supporting forward compatibility in cereal\_fwd.
