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
Kirill Smelkov
cython
Commits
af8b69ea
Commit
af8b69ea
authored
Jun 28, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved an example from wrapping_cplusplus.rst to the examples directory.
parent
084a25f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
16 deletions
+19
-16
docs/examples/userguide/wrapping_CPlusPlus/nested_class.pyx
docs/examples/userguide/wrapping_CPlusPlus/nested_class.pyx
+17
-0
docs/src/userguide/wrapping_CPlusPlus.rst
docs/src/userguide/wrapping_CPlusPlus.rst
+2
-16
No files found.
docs/examples/userguide/wrapping_CPlusPlus/nested_class.pyx
0 → 100644
View file @
af8b69ea
# distutils: language = c++
cdef
extern
from
"<vector>"
namespace
"std"
:
cdef
cppclass
vector
[
T
]:
cppclass
iterator
:
T
operator
*
()
iterator
operator
++
()
bint
operator
==
(
iterator
)
bint
operator
!=
(
iterator
)
vector
()
void
push_back
(
T
&
)
T
&
operator
[](
int
)
T
&
at
(
int
)
iterator
begin
()
iterator
end
()
cdef
vector
[
int
].
iterator
iter
#iter is declared as being of type vector<int>::iterator
docs/src/userguide/wrapping_CPlusPlus.rst
View file @
af8b69ea
...
...
@@ -252,23 +252,9 @@ themselves::
Nested class declarations
--------------------------
C++ allows nested class declaration. Class declarations can also be
nested in Cython:
:
nested in Cython:
cdef extern from "<vector>" namespace "std":
cdef cppclass vector[T]:
cppclass iterator:
T operator*()
iterator operator++()
bint operator==(iterator)
bint operator!=(iterator)
vector()
void push_back(T&)
T& operator[](int)
T& at(int)
iterator begin()
iterator end()
cdef vector[int].iterator iter #iter is declared as being of type vector<int>::iterator
.. literalinclude:: ../../examples/userguide/wrapping_CPlusPlus/nested_class.pyx
Note that the nested class is declared with a ``cppclass`` but without a ``cdef``.
...
...
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