Boost logo

Boost :

Subject: Re: [boost] [Boost.Serialization] Detecting if Boost.Serialization is supported for a type
From: Ioannis Papadopoulos (ipapadop_at_[hidden])
Date: 2010-10-20 18:20:34


On 10/19/2010 8:44 PM, Robert Ramey wrote:
> Ioannis Papadopoulos wrote:
>> Hi,
>>
>> I have two methods of serialization and I would like to choose between
>> them. One is Boost.Serialization and the other is my hand-made one.
>
> The library is built on the idea that one would make his own archive
> class for this.

Yes, but this implies that my serialization uses also the T::serialize()
function, which is not the case. Moreover, I want to use
Boost.Serialization as another means of serialization that can be
disabled and not derive from it.

My method uses a different function for that reason. It would be really
useful to have a method of identifying if Boost.Serialization is
supported through a trait.

I successfully made a template supports_boost_serialization<T> that
detects if T::serialize() exists.

However, I cannot address the case of a stand-alone serialize() function
- since there is a generic boost::serialization::serialize(Archive&, T&,
const unsigned int), there is not way (that I know of) to figure out if
non-intrusive serialization exists for a specific T.

>
> Robert Ramey
>
>> Is there any (relatively) portable way that can allow to find out if
>> Boost.Serialization is supported either through the intrusive or the
>> non-intrusive way without requiring from the user to add more in her
>> class to define the serialization method?
>>
>> Thanks
>>
>> _______________________________________________
>> Unsubscribe& other changes:
>> http://lists.boost.org/mailman/listinfo.cgi/boost
>
>
>
> _______________________________________________
> Unsubscribe& other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk