diff options
author | Robin Gareus <robin@gareus.org> | 2017-03-16 20:08:17 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-03-16 20:08:17 +0100 |
commit | a2094b6831edb25cf6dd1409ceee7bd0c56ece0d (patch) | |
tree | e6d674f2fbd80c2b82b65630554e407dbc340ba9 /libs/lua/LuaBridge/detail/Namespace.h | |
parent | 6c65fd41cb49cb34371f6091e54a4c507e6ba453 (diff) |
Lua: provide instance-equal check as '==' comparator.
This deprecated explicit the "sameinstance()" method
Diffstat (limited to 'libs/lua/LuaBridge/detail/Namespace.h')
-rw-r--r-- | libs/lua/LuaBridge/detail/Namespace.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/lua/LuaBridge/detail/Namespace.h b/libs/lua/LuaBridge/detail/Namespace.h index 3644b9e157..b661093e2b 100644 --- a/libs/lua/LuaBridge/detail/Namespace.h +++ b/libs/lua/LuaBridge/detail/Namespace.h @@ -579,10 +579,14 @@ private: createConstTable (name); lua_pushcfunction (L, &CFunc::gcMetaMethod <T>); rawsetfield (L, -2, "__gc"); + lua_pushcclosure (L, &CFunc::ClassEqualCheck <T>::f, 0); + rawsetfield (L, -2, "__eq"); createClassTable (name); lua_pushcfunction (L, &CFunc::gcMetaMethod <T>); rawsetfield (L, -2, "__gc"); + lua_pushcclosure (L, &CFunc::ClassEqualCheck <T>::f, 0); + rawsetfield (L, -2, "__eq"); createStaticTable (name); @@ -626,10 +630,14 @@ private: createConstTable (name); lua_pushcfunction (L, &CFunc::gcMetaMethod <T>); rawsetfield (L, -2, "__gc"); + lua_pushcclosure (L, &CFunc::ClassEqualCheck <T>::f, 0); + rawsetfield (L, -2, "__eq"); createClassTable (name); lua_pushcfunction (L, &CFunc::gcMetaMethod <T>); rawsetfield (L, -2, "__gc"); + lua_pushcclosure (L, &CFunc::ClassEqualCheck <T>::f, 0); + rawsetfield (L, -2, "__eq"); createStaticTable (name); @@ -1159,10 +1167,14 @@ private: createConstTable (name); lua_pushcfunction (L, &CFunc::gcMetaMethod <T>); rawsetfield (L, -2, "__gc"); + lua_pushcclosure (L, &CFunc::ClassEqualCheck <T>::f, 0); + rawsetfield (L, -2, "__eq"); createClassTable (name); lua_pushcfunction (L, &CFunc::gcMetaMethod <T>); rawsetfield (L, -2, "__gc"); + lua_pushcclosure (L, &CFunc::ClassEqualCheck <T>::f, 0); + rawsetfield (L, -2, "__eq"); createStaticTable (name); |