| 1645 | |
| 1646 | template <typename SzType, detail::enable_if_t<std::is_integral<SzType>::value, int> = 0> |
| 1647 | str(const char *c, const SzType &n) |
| 1648 | : object(PyUnicode_FromStringAndSize(c, ssize_t_cast(n)), stolen_t{}) { |
| 1649 | if (!m_ptr) { |
| 1650 | if (PyErr_Occurred()) { |
| 1651 | throw error_already_set(); |
| 1652 | } |
| 1653 | pybind11_fail("Could not allocate string object!"); |
| 1654 | } |
| 1655 | } |
| 1656 | |
| 1657 | // 'explicit' is explicitly omitted from the following constructors to allow implicit |
| 1658 | // conversion to py::str from C++ string-like objects |
nothing calls this directly
no test coverage detected