1 // Copyright Daniel Wallin 2008. 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)
5 #ifndef LUABIND_FUNCTION2_081014_HPP
6 # define LUABIND_FUNCTION2_081014_HPP
8 # include <luabind/make_function.hpp>
9 # include <luabind/scope.hpp>
10 # include <luabind/detail/call_function.hpp>
17 template <class F
, class Policies
>
18 struct function_registration
: registration
20 function_registration(char const* name
, F f
, Policies
const& policies
)
26 void register_(lua_State
* L
) const
28 object fn
= make_function(L
, f
, deduce_signature(f
), policies
);
31 object(from_stack(L
, -1))
42 LUABIND_API
bool is_luabind_function(lua_State
* L
, int index
);
46 template <class F
, class Policies
>
47 scope
def(char const* name
, F f
, Policies
const& policies
)
49 return scope(std::auto_ptr
<detail::registration
>(
50 new detail::function_registration
<F
, Policies
>(name
, f
, policies
)));
54 scope
def(char const* name
, F f
)
56 return def(name
, f
, detail::null_type());
59 } // namespace luabind
61 #endif // LUABIND_FUNCTION2_081014_HPP