Boost logo

Boost Users :

From: John Pye (john.pye_at_[hidden])
Date: 2007-04-25 20:38:57


Hi Robert,

Robert Ramey wrote:
> John Pye wrote:
>
>> However I keep seeing the same error message, and
>> can't work out what it means.
>>
>
> Try the following change:
>
>
>> int main(int argc, char *argv[]){
>>
>> const dd D(10,20); // note: const
>> const int x = 5; // note const
>>

OK, so objects-to-be-serialised must always be const. I didn't
understand the rationale but I'll accept that there a good-but-obscure
reason for it.

I have a problem now with the BOOST_IS_ABSTRACT(ClassName) macro.

What header file(s) must I include in order for that macro to behave
correctly? Note that I am inside a namespace{...}when I write this
macro. Should that be OK?

Finally, if my base class is abstract and also contains no data
requiring serialisation (I guess it's a base class for a Composite
design pattern) then is it OK that my serialize(...) routine is empty?

Cheers
JP

My output:

------8<-------
object.h:56: error: ‘is_abstract’ is not a template
object.h:56: error: explicit specialization of non-template
‘optx::boost::serialization::is_abstract’
object.h:56: error: ‘mpl’ has not been declared
object.h:56: error: ISO C++ forbids declaration of ‘bool_’ with no type
object.h:56: error: typedef name may not be a nested-name-specifier
object.h:56: error: expected ‘;’ before ‘<’ token
...
--------------

My header file:

------8<--------
...

#include <boost/archive/tmpdir.hpp>

#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>

#include <boost/serialization/base_object.hpp>
#include <boost/serialization/utility.hpp>
#include <boost/serialization/list.hpp>

namespace optx{
   
    class Point;

    /**
        Class to hold a generic 3-D object.

        Basic geometric operations of rotation and translation will be
provided
        as virtual methods.
    */
    class Object{
       ...
---------------


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