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:
Antoine Prouvost
2023-11-29 21:56:25 +01:00
committed by GitHub
parent 4bb6163b4f
commit a67d786571
3 changed files with 87 additions and 2 deletions

View File

@@ -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