Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2007-08-18 01:59:04


See below - Robert Ramey

Dominick Layfield wrote:
> When I try to compile an application that uses the Boost
> serialization library,
> I get some compilation errors that I don't understand.
>
> I've taken the code, and trimmed it down to the simplest possible
> case that
> produces the same error.
>
> Here's the code:
>
>
> // Test of Boost serialization library
> #include <sstream>
> #include <boost/archive/text_oarchive.hpp>
>
> class test_t {
> public:
> int i;
> template <class Archive> void serialize(Archive& ar, const
> unsigned int
> version ) { ar & i; }
> test_t(int _i) : i(_i) {};
> };
>
> int main(void) {
> std::ostringstream oss;
> boost::archive::text_oarchive oa(oss);
> // test_t test(1);
      const test_t t; // try this - see rational for explanation
> oa << test;
> return 0;
> }
>
>
>


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