mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-11 08:50:31 +00:00
Relax py::pickle() get/set type check
Fixes #1061. `T` and `const T &` are compatible types.
This commit is contained in:
@@ -293,7 +293,7 @@ struct pickle_factory;
|
||||
template <typename Get, typename Set,
|
||||
typename RetState, typename Self, typename NewInstance, typename ArgState>
|
||||
struct pickle_factory<Get, Set, RetState(Self), NewInstance(ArgState)> {
|
||||
static_assert(std::is_same<RetState, ArgState>::value,
|
||||
static_assert(std::is_same<intrinsic_t<RetState>, intrinsic_t<ArgState>>::value,
|
||||
"The type returned by `__getstate__` must be the same "
|
||||
"as the argument accepted by `__setstate__`");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user