mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 14:59:27 +00:00
Adds type_caster support for std::deque. (#1609)
* Adds std::deque to the types supported by list_caster in stl.h.
* Adds a new test_deque test in test_stl.{py,cpp}.
* Updates the documentation to include std::deque as a default
supported type.
This commit is contained in:
@@ -23,6 +23,15 @@ def test_vector(doc):
|
||||
assert m.cast_ptr_vector() == ["lvalue", "lvalue"]
|
||||
|
||||
|
||||
def test_deque(doc):
|
||||
"""std::deque <-> list"""
|
||||
lst = m.cast_deque()
|
||||
assert lst == [1]
|
||||
lst.append(2)
|
||||
assert m.load_deque(lst)
|
||||
assert m.load_deque(tuple(lst))
|
||||
|
||||
|
||||
def test_array(doc):
|
||||
"""std::array <-> list"""
|
||||
lst = m.cast_array()
|
||||
|
||||
Reference in New Issue
Block a user