Boost logo

Boost Users :

From: Richard Howells (richard_at_[hidden])
Date: 2005-05-23 10:25:46


>>One tip --> in 1.33 you will need to make the date const or oa << d will
>>fail.
>> Serialization is now enforcing this previously documented part of the
>>interface...

>>So

>> date d(2004, Apr, 5);

>>needs to be

>> const date d(2004, Apr, 5);

Is that for real? I admit I have not used this library so maybe I should be
ignored, but what is the reasoning for only being able to serialize consts?
At the moment it does not sound useful.

- R

-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Jeff Garland
Sent: 23 May 2005 16:02
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] static assertion in date_serialization_demo

On Mon, 23 May 2005 09:47:07 +0200, Paolo Coletta wrote
> Hi,
>
> I've tried to build this simple code using vc 7.1
>
> using namespace boost::gregorian;
>
> date d(2004, Apr, 5);
> std::ofstream ofs("date_demo.txt");
> boost::archive::text_oarchive oa(ofs);
> oa << d;

One tip --> in 1.33 you will need to make the date const or oa << d will
fail.
   Serialization is now enforcing this previously documented part of the
interface...

So

 date d(2004, Apr, 5);

needs to be

 const date d(2004, Apr, 5);

 
> but it fails due to a static assertion. The code is taken from the very
> first lines of boost_serialization_demo.cpp. It seems to compile
> with boost
> 1.32, but seems to fail with current boost.
>
> Since this demo is not be included in the jamfile (or I was not able
> to find it), I built it is using visual studio IDE.

It's missing :-(

> The compiler command-line options were:
> /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Gm /EHsc /RTC1 /MLd
> /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /nologo /c /Wp64 /ZI /TP
>
> I also tried to turn on/off the RTTI, but the result did not change.
>
> The error I get is
> d:\PROJECTS\boost\boost\archive\detail\oserializer.hpp(557) : error
> C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'
>
> Am I missing something?

Doesn't seem like it. I'm getting the same problem on Linux with gcc 3.x
even
with the modification suggested above. I'll look into it and let you know.
BTW, the regression tests are passing, so I'm unsure what's happened here...

Jeff
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


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