As Adam S noted in the comments, this error occurs when he tries to compile this simple code that uses the Selene library:
#include <selene.h> class C { public: bool get() const; }; bool C::get() const {return true;} int main() { sel::State state; state["C"].SetClass<C>("get", &C::get); }
The compiler cannot compile code in Class.h . It has two overloads of the member of the _register_member function of the Class class:
template <typename T, typename A, typename... Members> class Class : public BaseClass { private:
The compiler cannot select the second overload when a pointer to an element of the const function is passed as the third argument. There must be another overload that can take a member of the const function. It should be declared as follows:
template <typename Ret, typename... Args> void _register_member(lua_State *state, const char *fun_name, Ret(T::*fun)(Args...) const) ^^^^^
Without such an overload, the compiler selects the first overload, which is created to work with pointers to data elements (not members of a function) and cannot compile its code.
Thus, you cannot deal with const members when using the current version of the Selena library (in the way you do this, at least).
Constructor
source share