luabridge::getGlobalNamespace(lua_state)
.beginNamespace("Werner3D")
.beginClass<Werner3D::Entity>("Entity")
.addFunction<void(*)(float,float,float)>("setPosition", &Entity::setPosition)
.endClass()
.endNamespace();
// addFunction is defined as this:
template <class MemFn>
Class <T>& addFunction (charconst* name, MemFn mf)
{
CFunc::CallMemberFunctionHelper <MemFn, FuncTraits <MemFn>::isConstMemberFunction>::add (L, name, mf);
return *this;
}
// setPosition is defined as
void setPosition(float x, float y, float z){
transform.setOrigin(btVector3(x,y,z));
}
The error:
No matching member function for call to 'addFunction'
LuaBridge/detail/Namespace.h:794:16: Candidate function [with MemFn = void (*)(float, float, float)] not viable: no overload of 'setPosition' matching 'void (*)(float, float, float)' for 2nd argument
This is XCode 5 on OSX. I'm probably overlooking something obvious, but I have only limited experience with function pointers. Can anyone see the error?