#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 : ";
}
{
try
{
return 0;
}
catch (const std::exception& e)
{
return -1;
}
catch (...)
{
printf("Untyped exception!");
return -1;
}
}