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
558ef9ec
Commit
558ef9ec
authored
Jul 06, 2018
by
scoder
Committed by
GitHub
Jul 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2443 from gabrieldemarmiesse/test_wrapping_cplusplus_3
Added tests for "Using C++ in Cython" part 3
parents
88ffe8bb
bc26e4ed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
docs/examples/userguide/wrapping_CPlusPlus/function_templates.pyx
...mples/userguide/wrapping_CPlusPlus/function_templates.pyx
+7
-0
docs/src/userguide/wrapping_CPlusPlus.rst
docs/src/userguide/wrapping_CPlusPlus.rst
+2
-6
No files found.
docs/examples/userguide/wrapping_CPlusPlus/function_templates.pyx
0 → 100644
View file @
558ef9ec
# distutils: language = c++
cdef
extern
from
"<algorithm>"
namespace
"std"
:
T
max
[
T
](
T
a
,
T
b
)
print
(
max
[
long
](
3
,
4
))
print
(
max
(
1.5
,
2.5
))
# simple template argument deduction
docs/src/userguide/wrapping_CPlusPlus.rst
View file @
558ef9ec
...
@@ -339,13 +339,9 @@ a typedef for its template parameters it is preferable to use that name here.
...
@@ -339,13 +339,9 @@ a typedef for its template parameters it is preferable to use that name here.
Template functions are defined similarly to class templates, with
Template functions are defined similarly to class templates, with
the template parameter list following the function name:
:
the template parameter list following the function name:
cdef extern from "<algorithm>" namespace "std":
.. literalinclude:: ../../examples/userguide/wrapping_CPlusPlus/function_template.pyx
T max[T](T a, T b)
print(max[long](3, 4))
print(max(1.5, 2.5)) # simple template argument deduction
Standard library
Standard library
...
...
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