Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-04-14 14:03:00


Try putting your code into either the boost::logic::tribool or
boost::serialzation

Robert Ramey

Austin Bingham wrote:
> I've been trying to write serialization code for tribool, and I'm
> completely dumbfounded at this point. I'm using the "split free"
> approach, but no matter how I phrase things, the compiler never seems
> to believe that I've written code to de/serialize tribool. Here's an
> example of what doesn't work:
>

namespace boost { namespace logic {
> template <class Archive>
> void save(Archive& ar,
> const boost::logic::tribool& b,
> const unsigned int version)
> {
> // irrelevant
> }
>
> template <class Archive>
> void load(Archive& ar,
> boost::logic::tribool& b,
> const unsigned int version)
> {
> // irrelevant
> }
} }

>
> BOOST_SERIALIZATION_SPLIT_FREE(boost::logic::tribool);
>
> This *seems* correct, but the compiler complains that "tribool has no
> member named serialize". While this is true, the split-free technique
> means it won't be requested.
>
> Our code uses the split-free approach for other classes, so I'm fairly
> certain I know how to do it correctly. Is there something magical
> about tribool that makes this approach break? More importantly, is
> there a known way to de/serialize tribool? Thanks.


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