mirror of
https://github.com/RPCS3/cereal.git
synced 2024-11-27 13:10:43 +00:00
0c56175a1c
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
29 lines
673 B
C++
29 lines
673 B
C++
#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_
|