diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 67397c4ee7..eb6a42b471 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -11,6 +11,7 @@ #pragma once #include "pytypes.h" +#include "detail/common.h" #include "detail/typeid.h" #include "detail/descr.h" #include "detail/internals.h" @@ -775,7 +776,9 @@ template struct is_copy_constructible : std // so, copy constructability depends on whether the value_type is copy constructible. template struct is_copy_constructible, - std::is_same + std::is_same, + // Avoid infinite recursion + negation> >::value>> : is_copy_constructible {}; #if !defined(PYBIND11_CPP17)