Boost logo

Boost Users :

Subject: Re: [Boost-users] Using boost::serialization in real-timewithoutallocating memory
From: Robert Ramey (ramey_at_[hidden])
Date: 2009-09-18 14:00:09


Peter Soetens wrote:

> I'm got so far that I 'hacked' an allocation free output and output
> archive, and output works like a charm.

hmmm - you're making it look easy.

>But for the input side, I
> can't seem to get the ADL to work for serializing the nvt<T> case.
>
> The point I'm struggling with is that sometimes save() is a member
> function and sometimes it's a free function, and I can't get to the
> selection logic. The archiver in attachment fails to compile on line
> 68 where it says 'no matching function for call to
> ‘load(boost::archive::mqueue_tiny_iarchive&, const
> boost::serialization::nvp<double>&, int)', when reading back in an
> std::vector<double>.

Double check the namespaces in which you've declared
and implemented your save/load functions. It's very easy
to get that wrong. Also double check your arguments. Note that
the serialization library uses an obscure technique
to implement the equivalent of partial function template ordering.
This could also be confusing.

> I'm aware that this is no longer an serialization question, but I'm
> just one compile error away from the real solution :-) Maybe it
> wouldn't hurt to include some examples for serializing level 1/2
> objects which just implement the Archive concept interface.

Feel free to submit your example as a "case study" to the
serialization library documentation.

Robert Ramey


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