Skip to content

Commit 00bf8eb

Browse files
committed
Update README
1 parent 00d2b5a commit 00bf8eb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,7 +1985,17 @@ int main() {
19851985
auto d = std::make_shared<Bar>();
19861986
l.callf<void>("f", c, d);
19871987
assert(c->i == 2);
1988+
assert(a.i == 2);
19881989
assert(d->i == 100);
1990+
1991+
// Get the function
1992+
auto f = l.get<peacalm::luaw::function<
1993+
void(peacalm::luaw::ptrw<Foo>, std::shared_ptr<Bar>)>>("f");
1994+
f(c, d);
1995+
assert(!f.failed());
1996+
assert(c->i == 3);
1997+
assert(a.i == 3);
1998+
assert(d->i == 200);
19891999
}
19902000
```
19912001

0 commit comments

Comments
 (0)