About make_function definition in make_function.hpp
Baojiang Shou <[email protected]> Fri, 12 Jun 2015 21:48:54 +0800
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <CAMwKKsVGs_XQAB4-=2pEqqVkfABQ2Yb9i0DnAM3CsZ2SudGaag@mail.gmail.com> |
--===============2552391898573933733==
Content-Type: multipart/alternative; boundary=047d7b41cc8eaa78330518525f1b
--047d7b41cc8eaa78330518525f1b
Content-Type: text/plain; charset=UTF-8
Hi guys, I have an question in reading luabind code. At the bottom of file
make_function.hpp is the definitions of two function:
template <class F, class Signature, class Policies>
object make_function(lua_State* L, F f, Signature, Policies)
{
typedef typename detail::as_vector<Signature>::type signature;
return detail::make_function_aux(
L
, new detail::function_object_impl<F, signature, Policies>(
f, Policies()
)
);
}
template <class F>
object make_function(lua_State* L, F f)
{
return make_function(L, detail::deduce_signature(f), detail::null_type());
}
In the statement make_function(L, detail::deduce_signature(f),
detail::null_type()) which only provide three args, but the above
make_function need four args. Why?
--047d7b41cc8eaa78330518525f1b
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><p style=3D"font-size:14px">Hi guys, I have an question in=
reading luabind code. At the bottom of file make_function.hpp is the defin=
itions of two function:</p><p style=3D"font-size:14px"><font face=3D"arial,=
helvetica, sans-serif">template <class F, class Signature, class Polici=
es><br>object make_function(lua_State* L, F f, Signature, Policies)<br>{=
<br>typedef typename detail::as_vector<Signature>::type signature;</f=
ont></p><div style=3D"font-size:14px"><pre style=3D"white-space:pre-wrap"><=
font face=3D"arial, helvetica, sans-serif">return detail::make_function_aux=
(
L
, new detail::function_object_impl&lt;F, signature, Policies&gt;(
f, Policies()
)
);
</font></pre></div><p style=3D"font-size:14px"><font face=3D"arial, helveti=
ca, sans-serif">}</font></p><p style=3D"font-size:14px"><font face=3D"arial=
, helvetica, sans-serif">template <class F><br>object make_function(l=
ua_State* L, F f)<br>{<br>return make_function(L, detail::deduce_signature(=
f), detail::null_type());<br>}</font></p><p style=3D"font-size:14px">In the=
statement make_function(L, detail::deduce_signature(f), detail::null_type(=
)) which only provide three args, but the above make_function need four arg=
s. Why?</p></div>
--047d7b41cc8eaa78330518525f1b--
--===============2552391898573933733==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
--===============2552391898573933733==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user
--===============2552391898573933733==--