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
Boxiang Sun
cython
Commits
905a14ba
Commit
905a14ba
authored
Dec 04, 2016
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More template parameter inference.
parent
19d5dd91
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+1
-4
tests/run/cpp_template_functions.pyx
tests/run/cpp_template_functions.pyx
+3
-2
No files found.
Cython/Compiler/PyrexTypes.py
View file @
905a14ba
...
@@ -113,10 +113,7 @@ class BaseType(object):
...
@@ -113,10 +113,7 @@ class BaseType(object):
http://en.cppreference.com/w/cpp/language/function_template#Template_argument_deduction
http://en.cppreference.com/w/cpp/language/function_template#Template_argument_deduction
"""
"""
if
self
==
actual
:
return
{}
return
{}
else
:
return
None
def
__lt__
(
self
,
other
):
def
__lt__
(
self
,
other
):
"""
"""
...
...
tests/run/cpp_template_functions.pyx
View file @
905a14ba
...
@@ -37,11 +37,12 @@ def test_two_params(int x, int y):
...
@@ -37,11 +37,12 @@ def test_two_params(int x, int y):
def
test_method
(
int
x
,
int
y
):
def
test_method
(
int
x
,
int
y
):
"""
"""
>>> test_method(5, 10)
>>> test_method(5, 10)
((5, 10.0), (5.0, 10))
((5, 10.0), (5.0, 10)
, (5, 10), (5.0, 10)
)
"""
"""
cdef
A
[
int
]
a_int
cdef
A
[
int
]
a_int
cdef
A
[
double
]
a_double
cdef
A
[
double
]
a_double
return
a_int
.
method
[
float
](
x
,
y
),
a_double
.
method
[
int
](
x
,
y
)
return
(
a_int
.
method
[
float
](
x
,
y
),
a_double
.
method
[
int
](
x
,
y
),
a_int
.
method
(
x
,
y
),
a_double
.
method
(
x
,
y
))
# return a_int.method[double](x, y), a_double.method[int](x, y)
# return a_int.method[double](x, y), a_double.method[int](x, y)
def
test_part_method
(
int
x
,
int
y
):
def
test_part_method
(
int
x
,
int
y
):
...
...
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