This is a simple example of how to use Metall.
#include <iostream>
#include <boost/container/vector.hpp>
using vector_t =
boost::container::vector<int, metall::manager::allocator_type<int>>;
{
metall::create_only,
"/tmp/dir");
auto pvec =
manager.construct<vector_t>(
"vec")(
manager.get_allocator());
pvec->push_back(5);
}
auto pvec =
manager.find<vector_t>(
"vec").first;
pvec->push_back(10);
std::cout << (*pvec)[0] << std::endl;
std::cout << (*pvec)[1] << std::endl;
} else {
std::cerr << "Cannot open a Metall data store" << std::endl;
}
return 0;
}
int main()
Definition: jgraph.cpp:24