}
};
-
template <class T, class R>
struct CastClass
{
}
};
+ template <class T>
+ struct ClassEqualCheck<boost::shared_ptr<T> >
+ {
+ static int f (lua_State* L)
+ {
+ return PtrEqualCheck<T>::f (L);
+ }
+ };
+
+ template <class T>
+ struct ClassEqualCheck<boost::weak_ptr<T> >
+ {
+ static int f (lua_State* L)
+ {
+ return WPtrEqualCheck<T>::f (L);
+ }
+ };
+
template <class C, typename T>
static int getPtrProperty (lua_State* L)
{
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);
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);
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);