On my phone, so I try my best to describe my problem.
std::map myMap;
for(int i = 0; i != 30; i++)
myMap.insert( make_pair(i,i+1) );

ofstream ofs("test");
binary_oarchive oa(ofs);
oa<ofs.close();
ofs.clear();
myMap.clear();

Ifstream ifs("test");
binary_iarchive ia(ifs);
ia>>myMap;

This code will throw an exception "input stream error".
But if reducing the size of map like this
for(int i = 0;i != 20; i++)
It will run successful. Cause I can't figure it out so I seek your help.
Look forward to your reply.