From 0ac47ba0cb6d66c0496bb3669fddeed9a4c58c37 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 14 May 2003 01:25:08 +0000 Subject: [PATCH] added another held_type test that fails. --- luabind/object.hpp | 47 ----------------------------------------------- test/test_held_type.cpp | 5 +++-- 2 files changed, 3 insertions(+), 49 deletions(-) diff --git a/luabind/object.hpp b/luabind/object.hpp index 914fbda..0673d26 100644 --- a/luabind/object.hpp +++ b/luabind/object.hpp @@ -381,31 +381,6 @@ namespace luabind inline object at(const T& key); #endif -/* - template - inline object raw_at(const T& key) - { - lua_State* L = lua_state(); - pushvalue(); - detail::convert_to_lua(L, key); - lua_rawget(L, -2); - int ref = detail::ref(L); - lua_pop(L, 1); - return object(L, ref, true); - } - - template - inline object at(const T& key) - { - lua_State* L = lua_state(); - pushvalue(); - detail::convert_to_lua(L, key); - lua_gettable(L, -2); - int ref = detail::ref(L); - lua_pop(L, 1); - return object(L, ref, true); - } -*/ inline bool is_valid() const { return true; } lua_State* lua_state() const; void pushvalue() const; @@ -511,30 +486,8 @@ namespace luabind template inline object raw_at(const T& key); #endif -/* - template - inline object raw_at(const T& key) - { - pushvalue(); - detail::convert_to_lua(m_state, key); - lua_rawget(m_state, -2); - int ref = detail::ref(m_state); - lua_pop(m_state, 1); - return object(m_state, ref, true); - } template - inline object at(const T& key) - { - pushvalue(); - detail::convert_to_lua(m_state, key); - lua_gettable(m_state, -2); - int ref = detail::ref(m_state); - lua_pop(m_state, 1); - return object(m_state, ref, true); - } -*/ - template inline detail::proxy_object operator[](const T& key) const { detail::convert_to_lua(m_state, key); diff --git a/test/test_held_type.cpp b/test/test_held_type.cpp index 4cae2d9..9ddfd51 100644 --- a/test/test_held_type.cpp +++ b/test/test_held_type.cpp @@ -19,13 +19,14 @@ namespace struct held_type_test { - held_type_test() { feedback = 3; } + held_type_test(): val(4) { feedback = 3; } ~held_type_test() { feedback = 1; } + int val; }; void tester(held_type_test* t) { - feedback = 2; + if (t->val == 4) feedback = 2; } } // anonymous namespace -- 2.11.4.GIT