Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct A {
- virtual void foo() = 0;
- };
- void do_something(A* a) {
- a->foo();
- }
- class 'MyA' (A)
- ....
- function MyA:foo()
- print('hi')
- end
- ... // somehow create an instance of MyA class and named myA
- // How?
- // Maybe the result of a call to "MyA()"?
- do_something(myA);
- // C++
- struct LuaA : public A
- {
- LuaA(const std::string &luacode)
- : myLuaHandler(luacode)
- {
- }
- virtual void foo()
- {
- myLuaHandler.call("MyA:foo()");
- }
- }
- virtual void f(int a)
- {
- call<void>("f", a);
- }
Add Comment
Please, Sign In to add comment