This repository contains Boost Cpp Serialization snippets, I have actually a lot more snippets
but I have to refactor them before publishing so you can follow me on Github to stay tuned.
For Cpp nowadas there are no excuses to setup your environment in a painless manner, this is why
I recommend using vcpkg, which is what I use, with vcpkg install boost:x64-windows-static it downloaded and built
boost libraries. Then I open the vcproject file and add the following inside the Globals section:
<PropertyGroup Label="Globals"> <-- Find this tag, then in that tag add the two VcpkgTriplet tags-->
............
<VcpkgTriplet Condition="'$(Platform)'=='Win32'">x86-windows-static</VcpkgTriplet>
<VcpkgTriplet Condition="'$(Platform)'=='x64'">x64-windows-static</VcpkgTriplet>
..........This is how I set up my environment, I strongly encourage you to do the same, take a time reading about vcpkg
and enjoy modern Cpp made easy.
- BOOST_SERIALIZATION_SPLIT_FREE should always be executed outside any namespace.
- Don't forget the appropiate includes, if you serialize a shared_ptr you need the serialization/shared_ptr.hpp header file.
- Never use BOOST_EXPORT_CLASS for a base class.
- Port to CMake