MCPcopy Create free account
hub / github.com/pybind/pybind11 / get_pointer

Function get_pointer

include/pybind11/pytypes.h:2098–2105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2096 /// Get the pointer the capsule holds.
2097 template <typename T = void>
2098 T *get_pointer() const {
2099 const auto *name = this->name();
2100 T *result = static_cast<T *>(PyCapsule_GetPointer(m_ptr, name));
2101 if (!result) {
2102 throw error_already_set();
2103 }
2104 return result;
2105 }
2106
2107 /// Replaces a capsule's pointer *without* calling the destructor on the existing one.
2108 void set_pointer(const void *value) {

Callers

nothing calls this directly

Calls 1

nameMethod · 0.45

Tested by

no test coverage detected