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
Xavier Thompson
cython
Commits
915cc5d9
Commit
915cc5d9
authored
Jul 21, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix iteration over cypclass containers
parent
8c755a42
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+16
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
915cc5d9
...
...
@@ -2884,7 +2884,11 @@ class IteratorNode(ExprNode):
def
generate_result_code
(
self
,
code
):
sequence_type
=
self
.
sequence
.
type
if
sequence_type
.
is_cpp_class
:
if
sequence_type
.
is_cyp_class
:
begin_func
=
"%s->begin"
%
self
.
sequence
.
result
()
code
.
putln
(
"%s = %s();"
%
(
self
.
result
(),
begin_func
))
return
elif
sequence_type
.
is_cpp_class
:
if
self
.
sequence
.
is_name
:
# safe: C++ won't allow you to reassign to class references
begin_func
=
"%s.begin"
%
self
.
sequence
.
result
()
...
...
@@ -2991,7 +2995,17 @@ class IteratorNode(ExprNode):
sequence_type
=
self
.
sequence
.
type
if
self
.
reversed
:
code
.
putln
(
"if (%s < 0) break;"
%
self
.
counter_cname
)
if
sequence_type
.
is_cpp_class
:
if
sequence_type
.
is_cyp_class
:
end_func
=
"%s->end"
%
self
.
sequence
.
result
()
code
.
putln
(
"if (!(%s != %s())) break;"
%
(
self
.
result
(),
end_func
))
code
.
putln
(
"%s = *%s;"
%
(
result_name
,
self
.
result
()))
code
.
putln
(
"++%s;"
%
self
.
result
())
return
elif
sequence_type
.
is_cpp_class
:
if
self
.
cpp_iterator_cname
:
end_func
=
"%s->end"
%
self
.
cpp_iterator_cname
else
:
...
...
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