#include <iostream>
template <class CONTAINER>
{
for (const auto& e : m) std::cout << e.first << "=" << e.second << ", ";
std::cout << std::endl;
}
#include <iostream>
{
std::map<std::string, uint32_t> m1{{"one", 1}, {"two", 2}};
{
arch_out << m1;
}
std::map<std::string, uint32_t> m2;
{
arch_in >> m2;
}
std::cout << "Wrote: ";
std::cout << "Read : ";
}
#include <fstream>
#include <iostream>
{
std::map<std::string, uint32_t> m1{{"one", 1}, {"two", 2}};
{
std::ofstream ofs("file.bin");
auto arch_out = mrpt::serialization::archiveFrom<std::ostream>(ofs);
arch_out << m1;
}
std::map<std::string, uint32_t> m2;
{
std::ifstream ifs("file.bin");
auto arch_in = mrpt::serialization::archiveFrom<std::istream>(ifs);
arch_in >> m2;
}
std::cout << "Wrote: ";
std::cout << "Read : ";
}
int main(
int argc,
char** argv)
{
try
{
return 0;
}
catch (std::exception& e)
{
std::cout << "Exception: " << e.what() << std::endl;
return -1;
}
catch (...)
{
printf("Untyped exception!");
return -1;
}
}