mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
fix(stl_bind): Enable bind_map with using declarations. (#4952)
* Enable `bind_map` with `using` declarations. * style: pre-commit fixes * Enable directives in bind_vector * Add tests for bind_ and using directives * style: pre-commit fixes * Remove C++17 functions * Fix test comment * Add minimal user like map py test --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -353,3 +353,17 @@ def test_recursive_map():
|
||||
recursive_map[100][101] = m.RecursiveMap()
|
||||
recursive_map[100][102] = m.RecursiveMap()
|
||||
assert list(recursive_map[100].keys()) == [101, 102]
|
||||
|
||||
|
||||
def test_user_vector_like():
|
||||
vec = m.UserVectorLike()
|
||||
vec.append(2)
|
||||
assert vec[0] == 2
|
||||
assert len(vec) == 1
|
||||
|
||||
|
||||
def test_user_like_map():
|
||||
map = m.UserMapLike()
|
||||
map[33] = 44
|
||||
assert map[33] == 44
|
||||
assert len(map) == 1
|
||||
|
||||
Reference in New Issue
Block a user