5 LUABIND_ANONYMOUS_FIX
int feedback
= 0;
12 void f(A
*) { feedback
= 1; }
13 void f(B
*) { feedback
= 2; }
16 } // anonymous namespace
18 bool test_implicit_cast()
20 using namespace luabind
;
22 lua_State
* L
= lua_open();
24 int top
= lua_gettop(L
);
28 typedef void (test_implicit::*f1
)(A
*);
29 typedef void (test_implicit::*f2
)(B
*);
34 .def(constructor
<>()),
37 .def(constructor
<>()),
39 class_
<test_implicit
>("test")
41 .def("f", (f1
) &test_implicit::f
)
42 .def("f", (f2
) &test_implicit::f
)
45 if (dostring(L
, "a = A()")) return false;
46 if (dostring(L
, "b = B()")) return false;
47 if (dostring(L
, "t = test()")) return false;
49 if (dostring(L
, "t:f(a)")) return false;
50 if (feedback
!= 1) return false;
52 if (dostring(L
, "t:f(b)")) return false;
53 if (feedback
!= 2) return false;
55 if (top
!= lua_gettop(L
)) return false;