[serialization] : NVP macros and template classes

Hello, I have a template class as a base class I wish to serialize... In that case, the BOOST_SERIALIZATION_BASE_OBJECT_NVP does not work as it introduce < > caracters wich i guess are forbidden in the xml tag... Is there a nice way to solve this issue ? For now, I am only facing the 1 parameter case and thus defined a macro : #define BOOST_SERIALIZATION_BASE_OBJECT_TEMPLATE_NVP(classname,templateparameter) \ boost::serialization::make_nvp( \ BOOST_PP_STRINGIZE(classname)BOOST_PP_STRINGIZE(templateparameter), \ boost::serialization::base_object<classname<templateparameter>
(*this) \ )
which gives me somme acceptable behaviour... if I have ClassA<ParameterClass> as a base class I write BOOST_SERIALIZATION_BASE_OBJECT_TEMPLATE_NVP(ClassA,ParameterClass) instead of "usual" BOOST_SERIALIZATION_BASE_OBJECT_NVP(BaseClassName) Regards, Mathieu -- http://www.incub.net
participants (1)
-
Mathieu Peyréga