Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename T>
- T to_type(lua_State *L, int n)
- {
- return T();
- }
- template <>
- double to_type<double>(lua_State *L, int n)
- {
- return lua_tonumber(L, n);
- }
- template <>
- std::string to_type<std::string>(lua_State *L, int n)
- {
- return lua_tostring(L, n);
- }
- template <>
- bool to_type<bool>(lua_State *L, int n)
- {
- return lua_toboolean(L, n);
- }
- template <>
- int to_type<int>(lua_State *L, int n)
- {
- return lua_tonumber(L, n);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement