From 6ff6e6f5ac03af5831ee5079e360dff69615e834 Mon Sep 17 00:00:00 2001 From: Daniel Wallin Date: Wed, 3 Sep 2008 11:16:19 +0200 Subject: [PATCH] Added `get_const_holder()` overload for `boost::shared_ptr`. Everybody uses `boost::shared_ptr`. We might as well have this by default since it has no cost. This also simplifies the tests a bit, because they no longer have to care about workarounds for compilers with no ADL. --- luabind/class.hpp | 12 ++++++++++++ test/test_back_reference.cpp | 11 +---------- test/test_held_type.cpp | 5 ----- test/test_lua_classes.cpp | 5 ----- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/luabind/class.hpp b/luabind/class.hpp index 65059f9..719a8bc 100644 --- a/luabind/class.hpp +++ b/luabind/class.hpp @@ -120,6 +120,12 @@ #pragma warning(disable: 4355) #endif +namespace boost +{ + + template class shared_ptr; + +} // namespace boost namespace luabind { @@ -143,6 +149,12 @@ namespace luabind return 0; } + template + boost::shared_ptr* get_const_holder(boost::shared_ptr*) + { + return 0; + } + namespace detail { template diff --git a/test/test_back_reference.cpp b/test/test_back_reference.cpp index b201a3e..5d97884 100755 --- a/test/test_back_reference.cpp +++ b/test/test_back_reference.cpp @@ -29,19 +29,10 @@ using namespace luabind; #ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP namespace luabind { - using boost::get_pointer; + using boost::get_pointer; } #endif -namespace luabind -{ - template - boost::shared_ptr* get_const_holder(boost::shared_ptr*) - { - return 0; - } -} - struct base0 { virtual ~base0() {} diff --git a/test/test_held_type.cpp b/test/test_held_type.cpp index 587f6b7..e049002 100644 --- a/test/test_held_type.cpp +++ b/test/test_held_type.cpp @@ -32,11 +32,6 @@ namespace luabind { T* get_pointer(boost::shared_ptr const& p) { return p.get(); } #endif - template - boost::shared_ptr* get_const_holder(boost::shared_ptr const*) - { - return 0; - } } struct base : counted_type diff --git a/test/test_lua_classes.cpp b/test/test_lua_classes.cpp index c8fe0bc..9bdd500 100644 --- a/test/test_lua_classes.cpp +++ b/test/test_lua_classes.cpp @@ -34,11 +34,6 @@ namespace luabind { T* get_pointer(boost::shared_ptr const& p) { return p.get(); } #endif - template - boost::shared_ptr* get_const_holder(boost::shared_ptr*) - { - return 0; - } } using namespace luabind; -- 2.11.4.GIT