0

I am serializing some data with the cereal lib. I am serializing a number of variables, among float, double, std::vector.

I write it as

cereal::BinaryOutputArchive archive(ofile);
int _pts_size, _num_cams;
std::vector<point> _points;

(...)

archive(_pts_size, _num_cams, _points);

Can I read back _pts_size and _num_cams ONLY?

manatttta
  • 3,054
  • 4
  • 34
  • 72

1 Answers1

0

You can only do this if you are using a text based archive (XML/JSON) which allows you to use name-value-pairs to do out of order loading (see this page and search for "Out of order loading").

What you want to do is not possible using a binary archive, which must serially read in all of the serialized data.

Azoth
  • 1,652
  • 16
  • 24