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

Function c_str

include/pybind11/detail/internals.h:1036–1044  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1034/// suitable for c-style strings needed by Python internals (such as PyTypeObject's tp_name).
1035template <typename... Args>
1036const char *c_str(Args &&...args) {
1037 // GCC 4.8 doesn't like parameter unpack within lambda capture, so use
1038 // PYBIND11_LOCK_INTERNALS.
1039 auto &internals = get_internals();
1040 PYBIND11_LOCK_INTERNALS(internals);
1041 auto &strings = internals.static_strings;
1042 strings.emplace_front(std::forward<Args>(args)...);
1043 return strings.front().c_str();
1044}
1045
1046PYBIND11_NAMESPACE_END(detail)
1047

Callers 1

make_new_python_typeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected