diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/pybind11/cast.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 67397c4..605acb3 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -775,7 +775,9 @@ template <typename T, typename SFINAE = void> struct is_copy_constructible : std // so, copy constructability depends on whether the value_type is copy constructible. template <typename Container> struct is_copy_constructible<Container, enable_if_t<all_of< std::is_copy_constructible<Container>, - std::is_same<typename Container::value_type &, typename Container::reference> + std::is_same<typename Container::value_type &, typename Container::reference>, + // Avoid infinite recursion + negation<std::is_same<Container, typename Container::value_type>> >::value>> : is_copy_constructible<typename Container::value_type> {}; #if !defined(PYBIND11_CPP17) |