Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-09-29 02:28:10


Robert Ramey wrote:

> Robert Ramey wrote:
>
>> As I write thsi, I was going to mention that shared_ptr<T> has the
>> same problem --- But, it doesn't now I have to think about if there
>> is any problem at all or what.
>>
>> Robert Ramey
>
> Now I remember - shared_ptr is marked with no_tracking. That is we never
> serialize a pointer to a shared_ptr (makes sense!). Thus we never have to
> invoke BOOST_CLASS_EXPORT(shared_ptr<X>) .
>
> So, if boost::any can be no_tracking then there is not problem at all.
> Just implement serialization for boost::any<T> and be sure that
> BOOST_CLASS_EXPORT is applied to each T as usual.

The problem is: there's no boost::any<T>, there's boost::any, which is
non-template class. Any part of program can assign any type to boost::any.
It is very unreasonable to expect that user invokes

     BOOST_CLASS_EXPORT_GUID(any_value_holder<X>, "any_value_holder_X")

for all instantiations of any_value_holder<X> that are *implicitly* created
in the program. In fact, ordinary user does not even now that
any_value_holder exists.

So, my original question stands -- it is even possible to make boost::any
serializable?

- Volodya


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