Commit 558ef9ec authored by scoder's avatar scoder Committed by GitHub

Merge pull request #2443 from gabrieldemarmiesse/test_wrapping_cplusplus_3

Added tests for "Using C++ in Cython" part 3
parents 88ffe8bb 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
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment