Hi jsf,
While that's a clever way to store and retrieve values, the Args system is really intended to pass named arguments to functions, not as a database to hold arbitrary types. If we made it possible to do so, it would cause an unacceptably high performance penalty to most of the functions using Args and go beyond the intended purpose of that system.
Instead, you can already read and write most types used in ITensor, including standard library types such as std::vector, to files using the read and write functions provided with ITensor. Here is some example code showing how.
Writing objects to a file "myfile.dat":
auto v = vector<int>(4);
v[0] = 1;
v[1] = 3;
v[2] = 5;
v[3] = 9;
auto i = Index("i",2);
auto T = randomTensor(i);
std::ofstream f("myfile.dat",std::ios::binary);
write(f,v);
write(f,i);
write(f,T);
f.close();
Reading the data back in from the file:
std::ifstream f("myfile.dat",std::ios::binary);
vector<int> v;
read(f,v);
Index i;
read(f,i);
ITensor T;
read(f,T);
f.close();
Print(v.size());
Print(v[0]);
Print(v[1]);
Print(v[2]);
Print(v[3]);
Print(T);