Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
7dcbfe22
Commit
7dcbfe22
authored
Aug 13, 2016
by
Ivan Smirnov
Browse files
Add a missing bytes ctor from const char *
parent
c22fe428
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
include/pybind11/pytypes.h
include/pybind11/pytypes.h
+5
-0
No files found.
include/pybind11/pytypes.h
View file @
7dcbfe22
...
...
@@ -387,6 +387,11 @@ class bytes : public object {
public:
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
)
:
object
(
PYBIND11_BYTES_FROM_STRING_AND_SIZE
(
c
,
(
ssize_t
)
n
),
false
)
{
if
(
!
m_ptr
)
pybind11_fail
(
"Could not allocate bytes object!"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment