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

Loannis Papadopoulos wrote:
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.
Another hard case is inherited serialize methods - consider class T inheriting from class B, and B::serialize() exists. Does your implementation of supports_boost_serialization<T> detect that? If it does, I am interested in how. Ben

Nope, it does not - you'll either have to declare a new serialize() function or get it from the base class. eg struct A { template<typename Archive> void serialize(Archive&, const unsigned int) { } }; struct B : public A { using A::serialize; }; PS no offense, but my name is spelled with a capital 'I' not an 'L' :) On 10/21/2010 12:34 PM, Ben Hendrickson wrote:
Loannis Papadopoulos wrote:
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.
Another hard case is inherited serialize methods - consider class T inheriting from class B, and B::serialize() exists. Does your implementation of supports_boost_serialization<T> detect that? If it does, I am interested in how.
Ben _______________________________________________ Unsubscribe& other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

You can also have a look at http://groups.google.com/group/comp.lang.c++.moderated/tree/browse_frm/threa... I don't know if it will make it into Boost though. On 10/21/2010 12:34 PM, Ben Hendrickson wrote:
Loannis Papadopoulos wrote:
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.
Another hard case is inherited serialize methods - consider class T inheriting from class B, and B::serialize() exists. Does your implementation of supports_boost_serialization<T> detect that? If it does, I am interested in how.
Ben _______________________________________________ Unsubscribe& other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Ben Hendrickson
-
Ioannis Papadopoulos