mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 05:05:11 +00:00
Avoid infinite recursion in is_copy_constructible (#1910)
This commit is contained in:
parent
c9f5a464bc
commit
6ca312b3bc
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user