Boost logo

Boost Users :

From: Douglas Gregor (dgregor_at_[hidden])
Date: 2007-12-09 10:45:53


Ruediger Berlich wrote:
> Hi there,
>
>
>> Hmmm ...
>>
>> i have used non-intrusive serialization on a function object without
>> problems.
>>
>> So I don't see a problem here so I'm clearly missing something.
>>
>> Robert Ramey
>>
>
> See below for a working example. The code that doesn't work is commented out
> at the end. If boost::function would provide an access method for the
> objects stored in it, writing the serialization code would be no big deal,
> I would assume. As it is, however, I think I'll have to stick to the
> vector<shared_ptr<functionObject> > .
>
If you know the type of function object stored in the boost::function
object, you can extract a pointer to the object via the "target" method.
See:

  http://www.boost.org/doc/html/boost/function.html#id697895-bb

    - Doug


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