Commit 2e8a6192 authored by Valentin Valls's avatar Valentin Valls

Add erase/insert using double iterator to set

parent f173daf3
......@@ -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&)
......
......@@ -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()
......
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