Boost logo

Boost Users :

From: Gennady Khokhorin (gok_at_[hidden])
Date: 2007-04-18 20:18:25


Bill,
it is the same message with different subject. I'm not sure if previous will
show up on this thread as a respond to your sending.

-----Original Message-----
From: Gennady Khokhorin
Sent: Wednesday, April 18, 2007 2:45 PM
To: 'boost-users_at_[hidden]'
Subject: Re: store vector<> to filesystem (newbie question)

>template<typename Archive>
>struct Serializer {
> static void save(const vector<double>& timeStamps) {
> std::ofstream ofs("file.bin", std::ios::binary);
>
> Archive oa(ofs);
> oa << timeStamps;
> }
>};
>
>Serializer<binary_oarchive>::save(timeStamps);

Thanks, Bill, for your fast respond!

Started reading serialization.
Did try to use serialization from your sample, got stuck with error message:
Error 20 error C2039: 'serialize' : is not a member of 'std::vector<_Ty>' c:\boost\include\boost-1_33_1\boost\serialization\access.hpp 109
Is it restriction sign for using std::vector<> with << operator or I'm missing some headers?

my settings:
#include <boost\archive\binary_oarchive.hpp>
using namespace boost::archive;

gok


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