aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSamuel Debionne <samuel.debionne@esrf.fr>2019-09-19 21:23:03 +0200
committerWenzel Jakob <wenzel.jakob@epfl.ch>2019-09-19 21:24:05 +0200
commit6ca312b3bcdccdd55321dcf7111a50cad37a6c99 (patch)
treeb1256793deb54b50eb6b6e38b003dc0b1421563c /include
parentc9f5a464bc8ebe91dee8578b2b4a23d9997ffefe (diff)
downloadplatform_external_python_pybind11-6ca312b3bcdccdd55321dcf7111a50cad37a6c99.tar.gz
platform_external_python_pybind11-6ca312b3bcdccdd55321dcf7111a50cad37a6c99.tar.bz2
platform_external_python_pybind11-6ca312b3bcdccdd55321dcf7111a50cad37a6c99.zip
Avoid infinite recursion in is_copy_constructible (#1910)
Diffstat (limited to 'include')
-rw-r--r--include/pybind11/cast.h4
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)