Adding bitset and complex, both untested

This makes us "feature complete (tm)" as far as things that look worth serializing in the standard library

just need the unit tests for these then we can profile size and speed vs boost
This commit is contained in:
Shane Grant
2013-06-15 23:26:47 -07:00
parent adcc2532db
commit 0c56175a1c
4 changed files with 115 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#ifndef CEREAL_BINARY_ARCHIVE_COMPLEX_HPP_
#define CEREAL_BINARY_ARCHIVE_COMPLEX_HPP_
#include <cereal/binary_archive/binary_archive.hpp>
#include <complex>
namespace cereal
{
//! Serializing (save) for std::complex to binary
template <class T> inline
void save( BinaryOutputArchive & ar, std::complex<T> const & comp )
{
ar & comp.real();
ar & comp.imag();
}
//! Serializing (load) for std::complex to binary
template <class T> inline
void load( BinaryInputArchive & ar, std::complex<T> & bits )
{
T real, imag;
ar & real;
ar & imag;
bits = {real, imag};
}
} // namespace cereal
#endif // CEREAL_BINARY_ARCHIVE_COMPLEX_HPP_