From ad835520722a4383ae202ab902e5e704679087bc Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 6 Sep 2014 22:11:00 -0700 Subject: [PATCH] Remove bogus `userdata` specialization; that's not longer how we're detecting userdata. Fixed Readme example, removed bad uses of `local` --- README.md | 2 +- examples/userdata.cpp | 2 +- sol/types.hpp | 12 +----------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9ec1ff4d..5daebd20 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ struct vars { int main() { sol::state lua; lua.new_userdata("vars", "boop", &vars::boop); - lua.script("local beep = vars.new()\n" + lua.script("beep = vars.new()\n" "beep.boop = 1"); assert(lua.get("beep").boop == 1); } diff --git a/examples/userdata.cpp b/examples/userdata.cpp index 09ca6cc2..96d269f4 100644 --- a/examples/userdata.cpp +++ b/examples/userdata.cpp @@ -95,7 +95,7 @@ int main() { lua.new_userdata("variables", "low_gravity", &variables::low_gravity, "boost_level", &variables::boost_level); // making the class from lua is simple - // same with calling member functions + // same with calling member functions/variables lua.script("local vars = variables.new()\n" "assert(not vars.low_gravity)\n" "vars.low_gravity = true\n" diff --git a/sol/types.hpp b/sol/types.hpp index 108f221e..a72f09ce 100644 --- a/sol/types.hpp +++ b/sol/types.hpp @@ -96,16 +96,6 @@ class function; class object; namespace detail { -template -inline type usertype(std::true_type) { - return type::userdata; -} - -template -inline type usertype(std::false_type) { - return type::none; -} - template inline type arithmetic(std::true_type) { return type::number; @@ -113,7 +103,7 @@ inline type arithmetic(std::true_type) { template inline type arithmetic(std::false_type) { - return usertype(is_specialization_of{}); + return type::userdata; } } // detail