Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/pybind11/detail/type_caster_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -1019,8 +1019,8 @@ struct container_value_type_traits<
template <typename Container>
struct container_value_type_traits<
Container,
typename std::enable_if<
negation<std::is_same<typename Container::value_type, Container>>::value>::type> {
typename std::enable_if<!std::is_same<typename Container::value_type, Container>::value
&& !std::is_void<typename Container::value_type>::value>::type> {
static constexpr bool has_value_type = true;
static constexpr bool has_recursive_value_type = false;
};
Expand Down
11 changes: 11 additions & 0 deletions tests/test_copy_move.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,3 +567,14 @@ static_assert(std::is_copy_assignable<RecursiveMap>::value,
// "!pybind11::detail::is_move_assignable<RecursiveMap>::value");
static_assert(pybind11::detail::is_copy_assignable<RecursiveMap>::value,
"pybind11::detail::is_copy_assignable<RecursiveMap>::value");

// #5983: a `void` value_type does not make the type a container.
struct VoidValueType {
using value_type = void;
};
static_assert(pybind11::detail::is_move_constructible<VoidValueType>::value,
"pybind11::detail::is_move_constructible<VoidValueType>::value");
static_assert(pybind11::detail::is_copy_constructible<VoidValueType>::value,
"pybind11::detail::is_copy_constructible<VoidValueType>::value");
static_assert(pybind11::detail::is_copy_assignable<VoidValueType>::value,
"pybind11::detail::is_copy_assignable<VoidValueType>::value");
Loading