|
Boost : |
From: Darren Cook (darren_at_[hidden])
Date: 2004-09-28 03:57:59
I've a class like this:
class Example{
int str[BSize];
int *p;
};
Where p points to next available element (p==str+BSize is possible when it
is full). I.e. str is like begin() and p is like end(). I want to add a
serialize() function, something like this:
template<class Archive> void serialize(Archive &ar,const unsigned int){
ar & BOOST_SERIALIZATION_NVP(buf,p);
}
but there seems to be no support for buffers like this?
For the moment I've implemented using separate load/save functions, where
save writes the buffer size and load starts by reading it. While much
simpler than the load/save code I'm replacing, the above 1-liner is even
more appealing.
Darren
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk