Switch member function pointer and string pair in initialisation

This commit is contained in:
Rapptz 2014-04-27 02:35:11 -04:00
parent b323a62b2a
commit 2f76b96061
2 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ private:
void build_function_tables() {}
template<std::size_t n, typename... Args, typename Ret>
void build_function_tables(Ret T::* func, std::string name, Args&&... args) {
void build_function_tables(std::string name,Ret T::* func, Args&&... args) {
typedef typename std::decay<decltype(func)>::type fx_t;
functionnames.push_back(std::move(name));
functions.emplace_back(detail::make_unique<userdata_function<fx_t, T>>(std::move(func)));

View File

@ -358,7 +358,7 @@ TEST_CASE("tables/userdata", "Show that we can create classes from userdata and
sol::state lua;
sol::userdata<fuser> lc{ &fuser::add, "add", &fuser::add2, "add2" };
sol::userdata<fuser> lc{ "add", &fuser::add, "add2", &fuser::add2 };
lua.set_class(lc);
lua.script("a = fuser:new()\n"
@ -386,7 +386,7 @@ TEST_CASE("tables/userdata constructors", "Show that we can create classes from
sol::state lua;
sol::constructors<sol::types<>, sol::types<int>, sol::types<int, int>> con;
sol::userdata<crapola::fuser> lc("crapola_fuser", con, &crapola::fuser::add, "add", &crapola::fuser::add2, "add2");
sol::userdata<crapola::fuser> lc("crapola_fuser", con, "add", &crapola::fuser::add, "add2", &crapola::fuser::add2);
lua.set_class(lc);
lua.script(