Skip to content

Commit b72ac5f

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 e2eca4f commit b72ac5f

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
@@ -1069,7 +1069,7 @@ class class_ : public detail::generic_type {
10691069
record.holder_size = sizeof(holder_type);
10701070
record.init_instance = init_instance;
10711071
record.dealloc = dealloc;
1072-
record.default_holder = std::is_same<holder_type, std::unique_ptr<type>>::value;
1072+
record.default_holder = detail::is_instantiation<std::unique_ptr, holder_type>::value;
10731073

10741074
set_operator_new<type>(&record);
10751075

0 commit comments

Comments
 (0)