We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
static_assert()
1 parent 9adbb61 commit be3bafeCopy full SHA for be3bafe
include/pybind11/detail/struct_smart_holder.h
@@ -242,7 +242,9 @@ struct smart_holder {
242
std::string("smart_holder::extract_deleter() precondition failure (") + context
243
+ ").");
244
}
245
- return std::unique_ptr<D>(new D(custom_deleter_ptr->deleter)); // D must be copyable.
+ static_assert(std::is_copy_constructible<D>::value,
246
+ "Required for compatibility with smart_holder functionality.");
247
+ return std::unique_ptr<D>(new D(custom_deleter_ptr->deleter));
248
249
return nullptr;
250
0 commit comments