Adding pybind11::cast overload for rvalue references (#1260)

* Adding pybind11::cast overload for rvalue references
This commit is contained in:
Yannick Jadoul
2020-07-01 01:53:09 +02:00
committed by GitHub
parent fc3a4490b8
commit d54d6d8c61
3 changed files with 12 additions and 5 deletions

View File

@@ -218,7 +218,10 @@ def test_shared_ptr_from_this_and_references():
def test_move_only_holder():
a = m.TypeWithMoveOnlyHolder.make()
b = m.TypeWithMoveOnlyHolder.make_as_object()
stats = ConstructorStats.get(m.TypeWithMoveOnlyHolder)
assert stats.alive() == 2
del b
assert stats.alive() == 1
del a
assert stats.alive() == 0