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
Kirill Smelkov
cython
Commits
2ef200bd
Commit
2ef200bd
authored
Jul 23, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert stl map conversion to take const ref.
parent
770acb7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
Cython/Includes/libcpp/map.pxd
Cython/Includes/libcpp/map.pxd
+9
-5
Cython/Utility/CppConvert.pyx
Cython/Utility/CppConvert.pyx
+8
-8
No files found.
Cython/Includes/libcpp/map.pxd
View file @
2ef200bd
...
...
@@ -8,14 +8,18 @@ cdef extern from "<map>" namespace "std" nogil:
iterator
operator
--
()
bint
operator
==
(
iterator
)
bint
operator
!=
(
iterator
)
cppclass
const_iterator
:
pair
[
const
T
,
U
]
&
operator
*
()
const_iterator
operator
++
()
const_iterator
operator
--
()
bint
operator
==
(
const_iterator
)
bint
operator
!=
(
const_iterator
)
cppclass
reverse_iterator
:
pair
[
T
,
U
]
&
operator
*
()
iterator
operator
++
()
iterator
operator
--
()
bint
operator
==
(
reverse_iterator
)
bint
operator
!=
(
reverse_iterator
)
#cppclass const_iterator(iterator):
# pass
#cppclass const_reverse_iterator(reverse_iterator):
# pass
map
()
except
+
...
...
@@ -31,19 +35,19 @@ cdef extern from "<map>" namespace "std" nogil:
bint
operator
>=
(
map
&
,
map
&
)
U
&
at
(
T
&
)
iterator
begin
()
#const_iterator begin
()
const_iterator
const_begin
"begin"
()
void
clear
()
size_t
count
(
T
&
)
bint
empty
()
iterator
end
()
#const_iterator end
()
const_iterator
const_end
"end"
()
pair
[
iterator
,
iterator
]
equal_range
(
T
&
)
#pair[const_iterator, const_iterator] equal_range(key_type&)
void
erase
(
iterator
)
void
erase
(
iterator
,
iterator
)
size_t
erase
(
T
&
)
iterator
find
(
T
&
)
#const_iterator find(key_type
&)
const_iterator
const_find
"find"
(
T
&
)
pair
[
iterator
,
bint
]
insert
(
pair
[
T
,
U
])
# XXX pair[T,U]&
iterator
insert
(
iterator
,
pair
[
T
,
U
])
# XXX pair[T,U]&
#void insert(input_iterator, input_iterator)
...
...
Cython/Utility/CppConvert.pyx
View file @
2ef200bd
...
...
@@ -213,18 +213,18 @@ cdef extern from *:
cppclass
value_type
:
T
first
U
second
cppclass
iterator
:
cppclass
const_
iterator
:
value_type
&
operator
*
()
iterator
operator
++
()
bint
operator
!=
(
iterator
)
iterator
begin
()
iterator
end
()
const_
iterator
operator
++
()
bint
operator
!=
(
const_
iterator
)
const_
iterator
begin
()
const_
iterator
end
()
@
cname
(
"{{cname}}"
)
cdef
object
{{
cname
}}(
map
[
X
,
Y
]
s
):
cdef
object
{{
cname
}}(
const
map
[
X
,
Y
]
&
s
):
o
=
{}
cdef
map
[
X
,
Y
].
value_type
*
key_value
cdef
map
[
X
,
Y
].
iterator
iter
=
s
.
begin
()
cdef
const
map
[
X
,
Y
].
value_type
*
key_value
cdef
map
[
X
,
Y
].
const_
iterator
iter
=
s
.
begin
()
while
iter
!=
s
.
end
():
key_value
=
&
cython
.
operator
.
dereference
(
iter
)
o
[
X_to_py
(
key_value
.
first
)]
=
Y_to_py
(
key_value
.
second
)
...
...
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