Skip to content

Commit 2c282db

Browse files
trelauTrevor Laughlin
authored and
Trevor Laughlin
committed
Check default holder
-Recognize "std::unique_ptr<T, D>" as a default holder even if "D" doesn't match between base and derived holders
1 parent f7bc18f commit 2c282db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/pybind11/pybind11.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ class class_ : public detail::generic_type {
10521052
record.holder_size = sizeof(holder_type);
10531053
record.init_instance = init_instance;
10541054
record.dealloc = dealloc;
1055-
record.default_holder = std::is_same<holder_type, std::unique_ptr<type>>::value;
1055+
record.default_holder = detail::is_instantiation<std::unique_ptr, holder_type>::value;
10561056

10571057
set_operator_new<type>(&record);
10581058

0 commit comments

Comments
 (0)