Skip to content

Commit a7cd5cc

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 e76dff7 commit a7cd5cc

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
@@ -1057,7 +1057,7 @@ class class_ : public detail::generic_type {
10571057
record.holder_size = sizeof(holder_type);
10581058
record.init_instance = init_instance;
10591059
record.dealloc = dealloc;
1060-
record.default_holder = std::is_same<holder_type, std::unique_ptr<type>>::value;
1060+
record.default_holder = detail::is_instantiation<std::unique_ptr, holder_type>::value;
10611061

10621062
set_operator_new<type>(&record);
10631063

0 commit comments

Comments
 (0)