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
e5347fad
Commit
e5347fad
authored
Jul 27, 2015
by
Ian Henriksen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests to verify that c++ call operator overloading works with
overloaded signatures when using stack allocated objects.
parent
09874820
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
tests/run/cpp_call_stack_allocated.srctree
tests/run/cpp_call_stack_allocated.srctree
+8
-0
No files found.
tests/run/cpp_call_stack_allocated.srctree
View file @
e5347fad
...
@@ -19,6 +19,8 @@ public:
...
@@ -19,6 +19,8 @@ public:
wint() { val = 0; }
wint() { val = 0; }
wint(long long val) { this->val = val; }
wint(long long val) { this->val = val; }
long long &operator()() { return this->val; }
long long &operator()() { return this->val; }
long long operator()(long long i) { return this->val + i; }
long long operator()(long long i, long long j) { return this->val + i + j; }
};
};
######## call.pxd ########
######## call.pxd ########
...
@@ -29,6 +31,8 @@ cdef extern from "call.cpp" nogil:
...
@@ -29,6 +31,8 @@ cdef extern from "call.cpp" nogil:
wint()
wint()
wint(long long val)
wint(long long val)
long long& operator()()
long long& operator()()
long long operator()(long long i)
long long operator()(long long i, long long j)
######## call_stack_allocated.pyx ########
######## call_stack_allocated.pyx ########
...
@@ -39,4 +43,8 @@ def test():
...
@@ -39,4 +43,8 @@ def test():
cdef long long b = 3
cdef long long b = 3
b = a()
b = a()
assert b == 4
assert b == 4
b = a(1ll)
assert b == 5
b = a(1ll, 1ll)
assert b == 6
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