[C++-sig] enum pickle issue in boost python
shashankbapat at hotmail.com
Mon Nov 27 23:46:37 CET 2006
Yes. I am aware of the boost pickle tutorial. It is useful if I have some
complicated pickle logic in a class.
But if you see enum_ has reduce and reduce_ex already defined in that case I
shouldnt need to do anything special to get my enum pickled.
ie providing additional methods for each enum_ to ensure correct pickling
EnumTest is boost wrapper around an enum.
red = 1,
green = 2,
blue = 4
BOOST_PYTHON_MODULE( EnumTest )
boost::python::scope().attr("__doc__") = "Module to test Boost Python
boost::python::enum_<Color>( "Color" )
.value( "red", red )
.value( "green", green )
.value( "blue", blue )
Check how class.cpp is differnt from enum.cpp in a way it processes module
I can fix it myself but I was wondering why is enum_ doing things
differntly. May be this is just a mistake but may be there is a good reason.
In that case I ll fix it and it will break something else somewhere !
Any case I ll try cvs HEAD and let you know.
Stay up-to-date with your friends through the Windows Live Spaces friends
More information about the Cplusplus-sig