mirror of
https://github.com/boostorg/python.git
synced 2026-01-23 05:42:30 +00:00
additional compile-time check: must_be_derived_from_pickle_suite
[SVN r14568]
This commit is contained in:
@@ -200,6 +200,7 @@ class class_ : public objects::class_base
|
||||
template <typename PickleSuiteType>
|
||||
self& def_pickle(PickleSuiteType)
|
||||
{
|
||||
error_messages::must_be_derived_from_pickle_suite(PickleSuiteType());
|
||||
detail::pickle_suite_finalize<PickleSuiteType>::register_(
|
||||
*this,
|
||||
&PickleSuiteType::getinitargs,
|
||||
|
||||
@@ -13,11 +13,14 @@ namespace boost { namespace python {
|
||||
|
||||
handle<> make_instance_reduce_function();
|
||||
|
||||
struct pickle_suite;
|
||||
|
||||
namespace error_messages {
|
||||
|
||||
template <class T>
|
||||
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; }
|
||||
|
||||
Reference in New Issue
Block a user