aboutsummaryrefslogtreecommitdiff
path: root/src/lua/luaopen_types.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-08-17 00:15:05 +0800
committerchai <chaifix@163.com>2018-08-17 00:15:05 +0800
commit952748a86c4ddf1d7e47b358a64904c35bacd4aa (patch)
tree2b65d1021a5b62beac5ac6b229b43856eaec29e9 /src/lua/luaopen_types.h
parent7f7f6b3f19703eaeaad3801e47749e0173faa2fc (diff)
*update
Diffstat (limited to 'src/lua/luaopen_types.h')
-rw-r--r--src/lua/luaopen_types.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/lua/luaopen_types.h b/src/lua/luaopen_types.h
index be59157..78083c6 100644
--- a/src/lua/luaopen_types.h
+++ b/src/lua/luaopen_types.h
@@ -64,11 +64,14 @@ namespace lua
T* obj = (T*)object;
delete obj;
}
- T& operator *()
- {
- T* obj = (T*)object;
- return *obj;
- }
+ T* operator->()
+ {
+ return (T*)object;
+ }
+ T* getObject()
+ {
+ return (T*)object;
+ }
private:
Ref(const Ref<T>& ref);
};
@@ -97,12 +100,12 @@ namespace lua
template<class T>
Ref<T>& getRef()
{
- Ref<T>* ref = (Ref<T>*) reference;
- return *ref;
+ return *(Ref<T>*) reference;
}
- Reference* reference; // acctual object binded
const char* type; // type name and metatable name
+ Reference* reference; // acctual object binded
+
};
} // lua