Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
05eaaa26
Commit
05eaaa26
authored
6 years ago
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved a code snippet to the examples directory.
parent
084a25f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
docs/examples/userguide/wrapping_CPlusPlus/vector_demo.pyx
docs/examples/userguide/wrapping_CPlusPlus/vector_demo.pyx
+15
-0
docs/src/userguide/wrapping_CPlusPlus.rst
docs/src/userguide/wrapping_CPlusPlus.rst
+2
-11
No files found.
docs/examples/userguide/wrapping_CPlusPlus/vector_demo.pyx
0 → 100644
View file @
05eaaa26
# distutils: language = c++
from
libcpp.vector
cimport
vector
cdef
vector
[
int
]
vect
cdef
int
i
,
x
for
i
in
range
(
10
):
vect
.
push_back
(
i
)
for
i
in
range
(
10
):
print
(
vect
[
i
])
for
x
in
vect
:
print
(
x
)
This diff is collapsed.
Click to expand it.
docs/src/userguide/wrapping_CPlusPlus.rst
View file @
05eaaa26
...
...
@@ -355,18 +355,9 @@ Most of the containers of the C++ Standard Library have been declared
in pxd files located in ``/Cython/Includes/libcpp``. These containers
are: deque, list, map, pair, queue, set, stack, vector.
For example:
:
For example:
from libcpp.vector cimport vector
cdef vector[int] vect
cdef int i, x
for i in range(10):
vect.push_back(i)
for i in range(10):
print(vect[i])
for x in vect:
print(x)
.. literalinclude:: ../../examples/userguide/wrapping_CPlusPlus/vector_demo.pyx
The pxd files in ``/Cython/Includes/libcpp`` also work as good examples on
how to declare C++ classes.
...
...
This diff is collapsed.
Click to expand it.
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