From 2f76b960611d7515b6ade592ee3edcf4634082ff Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 27 Apr 2014 02:35:11 -0400 Subject: [PATCH] Switch member function pointer and string pair in initialisation --- sol/userdata.hpp | 2 +- tests.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sol/userdata.hpp b/sol/userdata.hpp index 661f27f6..0c1675e8 100644 --- a/sol/userdata.hpp +++ b/sol/userdata.hpp @@ -101,7 +101,7 @@ private: void build_function_tables() {} template - 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::type fx_t; functionnames.push_back(std::move(name)); functions.emplace_back(detail::make_unique>(std::move(func))); diff --git a/tests.cpp b/tests.cpp index c12cdf6d..52b739e8 100644 --- a/tests.cpp +++ b/tests.cpp @@ -358,7 +358,7 @@ TEST_CASE("tables/userdata", "Show that we can create classes from userdata and sol::state lua; - sol::userdata lc{ &fuser::add, "add", &fuser::add2, "add2" }; + sol::userdata 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> con; - sol::userdata lc("crapola_fuser", con, &crapola::fuser::add, "add", &crapola::fuser::add2, "add2"); + sol::userdata lc("crapola_fuser", con, "add", &crapola::fuser::add, "add2", &crapola::fuser::add2); lua.set_class(lc); lua.script(