From b305ab28c1350c580d3a65619f9287c0d384f5c4 Mon Sep 17 00:00:00 2001 From: Samuel Debionne Date: Wed, 18 Sep 2019 08:55:59 +0200 Subject: [PATCH] Avoid infinite recursion in is_copy_constructible --- include/pybind11/cast.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)