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

Method string_op

include/pybind11/pytypes.h:1794–1801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1792private:
1793 template <typename T>
1794 T string_op() const {
1795 char *buffer = nullptr;
1796 ssize_t length = 0;
1797 if (PyBytes_AsStringAndSize(m_ptr, &buffer, &length) != 0) {
1798 throw error_already_set();
1799 }
1800 return {buffer, static_cast<size_t>(length)};
1801 }
1802};
1803// Note: breathe >= 4.17.0 will fail to build docs if the below two constructors
1804// are included in the doxygen group; close here and reopen after as a workaround

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected