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
386ac5cb
Commit
386ac5cb
authored
Dec 27, 2015
by
Wenzel Jakob
Browse files
Merge pull request #51 from tmiasko/def_tuple
Create an empty python tuple in pybind::tuple default constructor.
parents
dd57a34e
c83e0622
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
include/pybind11/pytypes.h
include/pybind11/pytypes.h
+2
-2
No files found.
include/pybind11/pytypes.h
View file @
386ac5cb
...
...
@@ -372,8 +372,8 @@ public:
class
tuple
:
public
object
{
public:
PYBIND11_OBJECT
_DEFAULT
(
tuple
,
object
,
PyTuple_Check
)
tuple
(
size_t
size
)
:
object
(
PyTuple_New
((
Py_ssize_t
)
size
),
false
)
{
}
PYBIND11_OBJECT
(
tuple
,
object
,
PyTuple_Check
)
tuple
(
size_t
size
=
0
)
:
object
(
PyTuple_New
((
Py_ssize_t
)
size
),
false
)
{
}
size_t
size
()
const
{
return
(
size_t
)
PyTuple_Size
(
m_ptr
);
}
detail
::
tuple_accessor
operator
[](
size_t
index
)
{
return
detail
::
tuple_accessor
(
ptr
(),
index
);
}
};
...
...
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