From e25fee71a2c3ff1fe7fc6049e3824017d66ba240 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Mon, 22 Jul 2002 23:43:00 +0000 Subject: [PATCH] additional compile-time check: must_be_derived_from_pickle_suite [SVN r14568] --- include/boost/python/class.hpp | 1 + include/boost/python/object/pickle_support.hpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/boost/python/class.hpp b/include/boost/python/class.hpp index 8491ba9c..1abf41cb 100644 --- a/include/boost/python/class.hpp +++ b/include/boost/python/class.hpp @@ -200,6 +200,7 @@ class class_ : public objects::class_base template self& def_pickle(PickleSuiteType) { + error_messages::must_be_derived_from_pickle_suite(PickleSuiteType()); detail::pickle_suite_finalize::register_( *this, &PickleSuiteType::getinitargs, diff --git a/include/boost/python/object/pickle_support.hpp b/include/boost/python/object/pickle_support.hpp index 6b68c47a..44e2103e 100644 --- a/include/boost/python/object/pickle_support.hpp +++ b/include/boost/python/object/pickle_support.hpp @@ -13,11 +13,14 @@ namespace boost { namespace python { handle<> make_instance_reduce_function(); +struct pickle_suite; + namespace error_messages { template struct missing_pickle_suite_function_or_incorrect_signature {}; + inline void must_be_derived_from_pickle_suite(pickle_suite const&) {} } namespace detail { struct pickle_suite_registration; }