From 840eb84affa618dddf83ee8f61a0b95987fd5d2a Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Thu, 17 Jun 2021 13:13:21 -0700 Subject: [PATCH] Removing `std::get_deleter` `const_cast` to retest because the code has changed significantly. (#3045) --- include/pybind11/detail/smart_holder_poc.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/pybind11/detail/smart_holder_poc.h b/include/pybind11/detail/smart_holder_poc.h index 47d368b8b..4df9b42fb 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) { - // 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.");