diff --git a/include/boost/python/class_builder.hpp b/include/boost/python/class_builder.hpp index 7ef843c4..fb696f88 100644 --- a/include/boost/python/class_builder.hpp +++ b/include/boost/python/class_builder.hpp @@ -16,10 +16,14 @@ class class_builder : python_extension_class_converters // Works around MSVC6.x/GCC2.95.2 bug described below { public: - class_builder(module_builder& module, const char* name) + class_builder(module_builder& module, const char* name, + bool auto_pickle = false) : m_class(new detail::extension_class(name)) { module.add(ref(as_object(m_class.get()), ref::increment_count), name); + if (auto_pickle) { + add(ref(BOOST_PYTHON_CONVERSION::to_python(1)), "__auto_pickle__"); + } } ~class_builder()