Skip to content

Commit

Permalink
class_dunder_cpp_transporter(): replace obj.cast<std::string>() w…
Browse files Browse the repository at this point in the history
…ith `std::string(obj)`
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Aug 30, 2024
1 parent 80550a9 commit 80ca683
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/pybind11/detail/type_caster_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -787,13 +787,13 @@ inline object class_dunder_cpp_transporter(handle self,
const str &pybind11_platform_abi_id,
const capsule &cap_cpp_type_info,
const str &pointer_kind) {
auto pointer_kind_cpp = pointer_kind.cast<std::string>();
if (pybind11_platform_abi_id.cast<std::string>() != PYBIND11_PLATFORM_ABI_ID) {
if (std::string(pybind11_platform_abi_id) != PYBIND11_PLATFORM_ABI_ID) {
return none();
}
if (std::strcmp(cap_cpp_type_info.name(), "const std::type_info *") != 0) {
return none();
}
std::string pointer_kind_cpp(pointer_kind);
if (pointer_kind_cpp != "raw_pointer_ephemeral") {
throw std::runtime_error("Invalid pointer_kind: \"" + pointer_kind_cpp + "\"");
}
Expand Down

0 comments on commit 80ca683

Please sign in to comment.