[io] Add function to read and write container from and to file
Write some container to file (requires begin()
and end()
):
std::vector<double>(5, 0.0) v;
writeContainerToFile(v, "myvector.txt");
Read to a container from a file (requires being()
end()
and push_back()
):
auto v = readFileToContainer<std::vector<double>>("myvector.txt");
I found this quite useful recently.