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
bc26e4ed
Commit
bc26e4ed
authored
Jun 28, 2018
by
gabrieldemarmiesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved a template code snippet to the examples directory.
parent
084a25f5
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 @
bc26e4ed
# 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 @
bc26e4ed
...
...
@@ -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
the template parameter list following the function name:
:
the template parameter list following the function name:
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
.. literalinclude:: ../../examples/userguide/wrapping_CPlusPlus/function_template.pyx
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