This example shows how to use h5 to serialize/deserialize a std::complex<double>
object to/from a byte buffer.
#include <iostream>
int main() {
std::complex<double> original { 1.0, 2.0 };
std::cout << original << " == " << restored << "\n";
}
T deserialize(std::vector< std::byte > const &buf)
Deserialize an object from a byte buffer.
std::vector< std::byte > serialize(T const &x)
Serialize an object to a byte buffer.
Includes all relevant h5 headers.
Provides generic serialize and deserialize functions for types that can be read/written from/to HDF5.
Output: