boost::serialization: how to BOOST_CLASS_VERSION a template class?
Dear list, I use boost::serialization to serialize my classes. They are template classes that are instantiated and wrapped by SWIG. Everything works fine until I decide to use BOOST_CLASS_VERSION to set version for the class. The first parameter of BOOST_CLASS_VERSION(class, version) is a class but my template will only be instantiated by SWIG. The syntax does not allow me to do something like template<class T> BOOST_CLASS_VERSION(class<T>, version) or BOOST_CLASS_VERSION( template<class T>class <T>, version). What should I do? Many thanks in advance. Bo
what is SWIG?
the macro won't work with a template. one has to specialiae the class.
This issue is specifically discussed in the documentation.
Robert Ramey
use boost::serialization::version
Dear list,
I use boost::serialization to serialize my classes. They are template classes that are instantiated and wrapped by SWIG. Everything works fine until I decide to use BOOST_CLASS_VERSION to set version for the class.
The first parameter of BOOST_CLASS_VERSION(class, version) is a class but my template will only be instantiated by SWIG. The syntax does not allow me to do something like template<class T> BOOST_CLASS_VERSION(class<T>, version) or BOOST_CLASS_VERSION( template<class T>class <T>, version). What should I do?
Many thanks in advance. Bo
On 4/22/05, Robert Ramey
what is SWIG?
SWIG is a tool to wrap C++ classes so thay can be used as, for example, python classes. I write template classes in C++ and instantiate them with SWIG.
the macro won't work with a template. one has to specialiae the class. This issue is specifically discussed in the documentation.
I will try to use this macro in SWIG when I instantiate the template (and know the template parameter). Thanks. Bo
participants (2)
-
Bo Peng
-
Robert Ramey