luabind绑定重载函数写法

luabind绑定重载函数写法

// 函数重载写法
 //    (return_arg-type(*)(arg1-type,grg2-type,...))&function
    module(L)
    [
        def("greet", (void(*)(void))&greet),
  def("greet", (void(*)(long))&greet),
  def("greet", (long(*)(long,float))&greet)
    ];

 // 成员函数重载用法
 // (return_arg-type (classname::*)(arg1-type,grg2-type,...))&classname::class_memberfunction

你可能感兴趣的:(luabind绑定重载函数写法)