|
Boost Users : |
From: Robert Ramey (ramey_at_[hidden])
Date: 2008-08-09 15:18:29
troy d. straszheim wrote:
>> Hey,
>>
>> Here's an autoregistering serializable any, I think it qualifies as
>> hacky
>> and suboptimal. Of course the typeid(T).name() strings aren't
>> portable,
if you use serialization/extended_type_info, instead of typeid(T)name()
you can use the strings used by BOOST_CLASS_EXPORT which are portable.
>> and the implementation gets a little intimate with the
>> mechanics of registration, but it works... You could make this less
>> intrusive, I suppose, but without the venerable
>>
>> #define private public
>>
>> technique (still one of my all time favorite hacks)
>> I don't think you're going to get it completely nonintrusive.
>>
It looks like a good start. Perhaps a "little something" should
be added to the public interface of boost::any to support
serialization.
Robert Ramey
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