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
4d6f38c0
Commit
4d6f38c0
authored
May 16, 2015
by
da_woods
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documented ways of wrapping nonmember operators
parent
d62480c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
docs/src/userguide/wrapping_CPlusPlus.rst
docs/src/userguide/wrapping_CPlusPlus.rst
+8
-0
No files found.
docs/src/userguide/wrapping_CPlusPlus.rst
View file @
4d6f38c0
...
@@ -312,6 +312,10 @@ Cython uses C++ for overloading operators::
...
@@ -312,6 +312,10 @@ Cython uses C++ for overloading operators::
Foo* operator-(Foo)
Foo* operator-(Foo)
int operator*(Foo*)
int operator*(Foo*)
int operator/(int)
int operator/(int)
int operator*(int, Foo) # allows 1*Foo()
# nonmember operators can also be specified outside the class
double operator/(double, Foo)
cdef Foo* foo = new Foo()
cdef Foo* foo = new Foo()
cdef int x
cdef int x
...
@@ -321,6 +325,10 @@ Cython uses C++ for overloading operators::
...
@@ -321,6 +325,10 @@ Cython uses C++ for overloading operators::
x = foo[0] * foo2
x = foo[0] * foo2
x = foo[0] / 1
x = foo[0] / 1
x = 1*foo[0]
cdef double y
y = 2.0/foo[0]
cdef Foo f
cdef Foo f
foo = f + &f
foo = f + &f
...
...
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