diff --git a/include/pybind11/detail/smart_holder_poc.h b/include/pybind11/detail/smart_holder_poc.h index 76fe92e5c..36c873dce 100644 --- a/include/pybind11/detail/smart_holder_poc.h +++ b/include/pybind11/detail/smart_holder_poc.h @@ -195,8 +195,7 @@ struct smart_holder { } void reset_vptr_deleter_armed_flag(bool armed_flag) const { - // The const_cast is only for certain compilers (Ubuntu 20 GCC 6.3.0 being one). - auto vptr_del_ptr = const_cast(std::get_deleter(vptr)); + auto vptr_del_ptr = std::get_deleter(vptr); if (vptr_del_ptr == nullptr) { throw std::runtime_error( "smart_holder::reset_vptr_deleter_armed_flag() called in an invalid context.");