Boost logo

Boost Users :

Subject: Re: [Boost-users] How to use boost serialization and standard arrays?
From: D. R. Evans (doc.evans_at_[hidden])
Date: 2012-12-30 11:25:48


Robert Ramey said the following at 12/29/2012 10:04 PM :
> #include <boost/serialization/array.hpp>
>
> is designed to permit the following:
>
> void archive_data(void)
>
>{ ofstream ofs(context.archive_name());
> boost::archive::binary_oarchive ar(ofs);
>
> int test[10]
> ar << test;
> }
>

Really??! Sheesh! I wish it had said that in the documentation instead of what
it does say:

> This group of headers includes templates which implement serialization for
> Standard Library or Boost Library templates. Any program which uses these
> templates can invoke serialization of objects of these types just by
> including the corresponding header.

That sure makes it sound like it's supposed to work with Standard Library
arrays... which was why I spent a bunch of time trying to figure out what I
was doing wrong before finally coming here. I even looked briefly at the
header file, and I didn't see any comment there to the effect of: "this is
designed for C-style arrays, not Standard Library array containers".

> I don't know if anyone has implemented serialization for boost::array or
> std::array.

OK; I'll just iterate and serialize the individual components myself.

Thank you for taking the trouble to reply; I appreciate it.

  Doc

-- 
Web:  http://www.sff.net/people/N7DR



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net