Avoid infinite recursion in is_copy_constructible (#1910)

This commit is contained in:
Samuel Debionne 2019-09-19 21:23:03 +02:00 committed by Wenzel Jakob
parent c9f5a464bc
commit 6ca312b3bc

View File

@ -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)