[Boost.Serialization] Detecting if Boost.Serialization is supported for a type

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. 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

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. 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

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

Ioannis Papadopoulos wrote:
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.
look at boost/serialization/level.hpp and level_enum.hpp I doubt that it will help though Robert Ramey

On 10/20/2010 09:24 PM, Robert Ramey wrote:
Ioannis Papadopoulos wrote:
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.
look at boost/serialization/level.hpp and level_enum.hpp
I doubt that it will help though
Robert Ramey
Hmm, I've looked at it, but I can't find anything that works. Is there any need/will to provide a boost::serialization::is_serializable<T> trait? Thanks
participants (2)
-
Ioannis Papadopoulos
-
Robert Ramey