Commit 173d4156 authored by Valentin Valls's avatar Valentin Valls

Add const at to map

parent f0043eb7
...@@ -39,6 +39,7 @@ cdef extern from "<map>" namespace "std" nogil: ...@@ -39,6 +39,7 @@ cdef extern from "<map>" namespace "std" nogil:
bint operator<=(map&, map&) bint operator<=(map&, map&)
bint operator>=(map&, map&) bint operator>=(map&, map&)
U& at(const T&) except + U& at(const T&) except +
const U& const_at "at"(const T&) except +
iterator begin() iterator begin()
const_iterator const_begin "begin" () const_iterator const_begin "begin" ()
void clear() void clear()
......
...@@ -9,6 +9,7 @@ from libcpp.queue cimport queue ...@@ -9,6 +9,7 @@ from libcpp.queue cimport queue
from libcpp.queue cimport priority_queue from libcpp.queue cimport priority_queue
from libcpp.vector cimport vector from libcpp.vector cimport vector
from libcpp.pair cimport pair from libcpp.pair cimport pair
from libcpp.map cimport map
def test_vector_functionality(): def test_vector_functionality():
...@@ -58,6 +59,19 @@ def test_priority_queue_functionality(): ...@@ -58,6 +59,19 @@ def test_priority_queue_functionality():
return "pass" return "pass"
def test_map_functionality():
"""
>>> test_map_functionality()
'pass'
"""
cdef:
map[int, const void*] int_map
const void* data
int_map[77] = NULL
data = int_map.const_at(77)
return "pass"
def test_unordered_map_functionality(): def test_unordered_map_functionality():
""" """
>>> test_unordered_map_functionality() >>> test_unordered_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