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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
857771c7
Commit
857771c7
authored
Oct 30, 2012
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nested class tests.
parent
f9068f3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
tests/run/cpp_nested_classes.pyx
tests/run/cpp_nested_classes.pyx
+23
-0
tests/run/cpp_nested_classes_support.cpp
tests/run/cpp_nested_classes_support.cpp
+14
-0
No files found.
tests/run/cpp_nested_classes.pyx
0 → 100644
View file @
857771c7
# tag: cpp
cdef
extern
from
"cpp_nested_classes_support.cpp"
:
cdef
cppclass
A
:
cppclass
B
:
int
square
(
int
)
cppclass
C
:
int
cube
(
int
)
B
*
createB
()
def
test
():
"""
>>> test()
"""
cdef
A
a
cdef
A
.
B
b
assert
b
.
square
(
3
)
==
9
cdef
A
.
B
.
C
c
assert
c
.
cube
(
3
)
==
27
cdef
A
.
B
*
b_ptr
=
a
.
createB
()
assert
b_ptr
.
square
(
4
)
==
16
del
b_ptr
tests/run/cpp_nested_classes_support.cpp
0 → 100644
View file @
857771c7
class
A
{
public:
class
B
{
public:
int
square
(
int
x
)
{
return
x
*
x
;
}
class
C
{
public:
int
cube
(
int
x
)
{
return
x
*
x
*
x
;
}
};
};
B
*
createB
()
{
return
new
B
();
}
};
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