Originally Posted by
phantomotap
It can. I suggest you try a few examples and see for yourself.
It can, if I get careless and throw a std::string at it... whose default constructor makes an empty string.
I just have to insert the binary representation of the filled object directly into the file to use the std::strings, std::vectors, std::map..etc.
However, this, an std::array works as expected:
Code:
mm::MFile mf("a.dat");
auto& myarray = mf.get_obj<std::array<int,5>>(0); // 0 is the offset, in bytes.. replacing it with another no. works equally fine.
for(int i=0;i<5;i++)myarray[i]=i;
for(auto x : mf.get_obj<std::array<int,5>>(0))
std::cout<<x<<std::endl;