Commit 6ca312b3 by Samuel Debionne Committed by Wenzel Jakob

Avoid infinite recursion in is_copy_constructible (#1910)

parent c9f5a464
...@@ -775,7 +775,9 @@ template <typename T, typename SFINAE = void> struct is_copy_constructible : std ...@@ -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. // 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< template <typename Container> struct is_copy_constructible<Container, enable_if_t<all_of<
std::is_copy_constructible<Container>, 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> {}; >::value>> : is_copy_constructible<typename Container::value_type> {};
#if !defined(PYBIND11_CPP17) #if !defined(PYBIND11_CPP17)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment