Commit ce9d1765 authored by Valentin Valls's avatar Valentin Valls

Add const_at to unordered map

parent 2e8a6192
......@@ -32,7 +32,8 @@ cdef extern from "<unordered_map>" namespace "std" nogil:
bint operator>(unordered_map&, unordered_map&)
bint operator<=(unordered_map&, unordered_map&)
bint operator>=(unordered_map&, unordered_map&)
U& at(T&)
U& at(const T&)
const U& const_at "at"(const T&)
iterator begin()
const_iterator const_begin "begin"()
void clear()
......
......@@ -151,6 +151,8 @@ def test_unordered_map_functionality():
unordered_map[int,int].iterator iterator = int_map.begin()
pair[unordered_map[int,int].iterator, bint] pair_iter = int_map.insert(pair_insert)
unordered_map[int, int] int_map2
unordered_map[int, int*] intptr_map
const int* intptr
assert int_map[1] == 2
assert int_map.size() == 1
assert int_map.erase(1) == 1 # returns number of elements erased
......@@ -178,4 +180,7 @@ def test_unordered_map_functionality():
int_map.bucket_count()
int_map.max_bucket_count()
int_map.bucket(3)
intptr_map[0] = NULL
intptr = intptr_map.const_at(0)
return "pass"
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