Relax py::pickle() get/set type check

Fixes #1061.

`T` and `const T &` are compatible types.
This commit is contained in:
Dean Moldovan
2017-09-04 23:46:11 +02:00
parent 7939f4b3fe
commit 00b8f3655d
3 changed files with 5 additions and 2 deletions

View File

@@ -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__`");