mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-29 08:32:02 +00:00
Add a missing bytes ctor from const char *
This commit is contained in:
parent
c22fe428ed
commit
7dcbfe228e
@ -387,6 +387,11 @@ class bytes : public object {
|
|||||||
public:
|
public:
|
||||||
PYBIND11_OBJECT_DEFAULT(bytes, object, PYBIND11_BYTES_CHECK)
|
PYBIND11_OBJECT_DEFAULT(bytes, object, PYBIND11_BYTES_CHECK)
|
||||||
|
|
||||||
|
bytes(const char *c)
|
||||||
|
: object(PYBIND11_BYTES_FROM_STRING(c), false) {
|
||||||
|
if (!m_ptr) pybind11_fail("Could not allocate bytes object!");
|
||||||
|
}
|
||||||
|
|
||||||
bytes(const char *c, size_t n)
|
bytes(const char *c, size_t n)
|
||||||
: object(PYBIND11_BYTES_FROM_STRING_AND_SIZE(c, (ssize_t) n), false) {
|
: object(PYBIND11_BYTES_FROM_STRING_AND_SIZE(c, (ssize_t) n), false) {
|
||||||
if (!m_ptr) pybind11_fail("Could not allocate bytes object!");
|
if (!m_ptr) pybind11_fail("Could not allocate bytes object!");
|
||||||
|
Loading…
Reference in New Issue
Block a user