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
2e8a6192
Commit
2e8a6192
authored
Apr 20, 2018
by
Valentin Valls
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add erase/insert using double iterator to set
parent
f173daf3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
Cython/Includes/libcpp/set.pxd
Cython/Includes/libcpp/set.pxd
+3
-3
tests/run/cpp_stl_cpp11.pyx
tests/run/cpp_stl_cpp11.pyx
+17
-0
No files found.
Cython/Includes/libcpp/set.pxd
View file @
2e8a6192
...
...
@@ -38,14 +38,14 @@ cdef extern from "<set>" namespace "std" nogil:
const_iterator
const_end
"end"
()
pair
[
iterator
,
iterator
]
equal_range
(
const
T
&
)
#pair[const_iterator, const_iterator] equal_range(T&)
void
erase
(
iterator
)
void
erase
(
iterator
,
iterator
)
iterator
erase
(
const_
iterator
)
iterator
erase
(
const_iterator
,
const_
iterator
)
size_t
erase
(
T
&
)
iterator
find
(
T
&
)
const_iterator
const_find
"find"
(
T
&
)
pair
[
iterator
,
bint
]
insert
(
const
T
&
)
except
+
iterator
insert
(
iterator
,
const
T
&
)
except
+
#void insert(input_iterator, input_iterator)
void
insert
(
iterator
,
iterator
)
except
+
#key_compare key_comp()
iterator
lower_bound
(
T
&
)
const_iterator
const_lower_bound
"lower_bound"
(
T
&
)
...
...
tests/run/cpp_stl_cpp11.pyx
View file @
2e8a6192
...
...
@@ -11,6 +11,7 @@ from libcpp.queue cimport priority_queue
from
libcpp.vector
cimport
vector
from
libcpp.pair
cimport
pair
from
libcpp.map
cimport
map
from
libcpp.set
cimport
set
from
libcpp.deque
cimport
deque
...
...
@@ -73,6 +74,22 @@ def test_priority_queue_functionality():
return
"pass"
def
test_set_functionality
():
"""
>>> test_set_functionality()
'pass'
"""
cdef
:
set
[
int
]
int_set
set
[
int
]
int_set2
int_set2
.
insert
(
77
)
int_set2
.
insert
(
66
)
int_set
.
insert
(
int_set2
.
const_begin
(),
int_set2
.
const_end
())
assert
int_set
.
size
()
==
2
assert
int_set
.
erase
(
int_set
.
const_begin
(),
int_set
.
const_end
())
==
int_set
.
end
()
return
"pass"
def
test_map_functionality
():
"""
>>> test_map_functionality()
...
...
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