1 // Copyright Daniel Wallin 2009. Use, modification and distribution is
2 // subject to the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #include <luabind/luabind.hpp>
21 int combine_score(int s1
, int s2
)
23 if (s1
< 0 || s2
< 0) return -1;
28 struct default_converter
<X
>
29 : native_converter_base
<X
>
31 int const consumed_args(...)
36 int compute_score(lua_State
* L
, int index
)
39 c1
.compute_score(L
, index
), c2
.compute_score(L
, index
+ 1));
42 X
from(lua_State
* L
, int index
)
44 return X(lua_tonumber(L
, index
), lua_tonumber(L
, index
+ 1));
47 default_converter
<int> c1
;
48 default_converter
<int> c2
;
51 } // namespace luabind
58 void test_main(lua_State
* L
)
60 using namespace luabind
;
67 "assert(take(1,1) == 2)\n"
68 "assert(take(2,3) == 5)\n"