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

Function format_ptrs

tests/constructor_stats.h:260–260  ·  view source on GitHub ↗

Don't cast pointers to Python, print them as strings

Source from the content-addressed store, hash-verified

258
259/// Don't cast pointers to Python, print them as strings
260inline const char *format_ptrs(const char *p) { return p; }
261template <typename T>
262py::str format_ptrs(T *p) {
263 return "{:#x}"_s.format(reinterpret_cast<std::uintptr_t>(p));

Callers 1

print_constr_detailsFunction · 0.85

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected