Skip to content

Commit 09c1821

Browse files
wxmerktjorisv
authored andcommitted
unittest: Explicitly extract shared_ptr to avoid ambiguity
between shared_ptr& and shared_ptr
1 parent a4bfaa8 commit 09c1821

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

unittest/bind_virtual_factory.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ struct VirtualClassWrapper : MyVirtualClass, bp::wrapper<MyVirtualClass> {
7272
}
7373

7474
shared_ptr<MyVirtualData> createData() const override {
75-
if (bp::override fo = this->get_override("createData")) return fo();
75+
if (bp::override fo = this->get_override("createData")) {
76+
bp::object result = fo();
77+
return bp::extract<shared_ptr<MyVirtualData>>(result);
78+
}
7679
return default_createData();
7780
}
7881

0 commit comments

Comments
 (0)