We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
std::get_deleter
const_cast
1 parent 4f61912 commit 840eb84Copy full SHA for 840eb84
include/pybind11/detail/smart_holder_poc.h
@@ -195,8 +195,7 @@ struct smart_holder {
195
}
196
197
void reset_vptr_deleter_armed_flag(bool armed_flag) {
198
- // The const_cast is only for certain compilers (Ubuntu 20 GCC 6.3.0 being one).
199
- auto vptr_del_ptr = const_cast<guarded_delete *>(std::get_deleter<guarded_delete>(vptr));
+ auto vptr_del_ptr = std::get_deleter<guarded_delete>(vptr);
200
if (vptr_del_ptr == nullptr) {
201
throw std::runtime_error(
202
"smart_holder::reset_vptr_deleter_armed_flag() called in an invalid context.");
0 commit comments