Remove bogus userdata<T> specialization; that's not longer how we're detecting userdata.

Fixed Readme example, removed bad uses of `local`
This commit is contained in:
ThePhD 2014-09-06 22:11:00 -07:00
parent 0a2050769c
commit ad83552072
3 changed files with 3 additions and 13 deletions

View File

@ -31,7 +31,7 @@ struct vars {
int main() {
sol::state lua;
lua.new_userdata<vars>("vars", "boop", &vars::boop);
lua.script("local beep = vars.new()\n"
lua.script("beep = vars.new()\n"
"beep.boop = 1");
assert(lua.get<vars>("beep").boop == 1);
}

View File

@ -95,7 +95,7 @@ int main() {
lua.new_userdata<variables>("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"

View File

@ -96,16 +96,6 @@ class function;
class object;
namespace detail {
template<typename T>
inline type usertype(std::true_type) {
return type::userdata;
}
template<typename T>
inline type usertype(std::false_type) {
return type::none;
}
template<typename T>
inline type arithmetic(std::true_type) {
return type::number;
@ -113,7 +103,7 @@ inline type arithmetic(std::true_type) {
template<typename T>
inline type arithmetic(std::false_type) {
return usertype<T>(is_specialization_of<T, userdata>{});
return type::userdata;
}
} // detail