[luabind-cvs] luabind/luabind/test test_has_get_pointer.cpp,1.1.2.1,1.1.2.2
Brought to you by:
arvidn,
daniel_wallin
From: Daniel W. <dan...@us...> - 2005-10-23 21:38:40
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25052 Modified Files: Tag: beta7-devel2 test_has_get_pointer.cpp Log Message: Removed commented out test code. Index: test_has_get_pointer.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/Attic/test_has_get_pointer.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- test_has_get_pointer.cpp 23 Oct 2005 21:35:21 -0000 1.1.2.1 +++ test_has_get_pointer.cpp 23 Oct 2005 21:38:32 -0000 1.1.2.2 @@ -56,117 +56,3 @@ BOOST_MPL_ASSERT_NOT(( lb::has_get_pointer<int> )); BOOST_MPL_ASSERT_NOT(( lb::has_get_pointer<test::X> )); -int main() -{ - using namespace luabind; - - test::Y const x; - char* z; - char*& y = z; - - get_pointer(x); -} - -#if 0 -template<class T> -struct X -{ -}; - -#include <boost/mpl/bool.hpp> -#include <boost/get_pointer.hpp> -#include <boost/shared_ptr.hpp> - -namespace luabind { - -#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -using boost::get_pointer; -#endif - -namespace has_get_pointer_ -{ - struct any - { - template<class T> - any(T const&); - }; - - struct tag {}; - - tag operator,(tag,int); - -#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -} // namespace has_get_pointer_ -#endif - - has_get_pointer_::tag get_pointer(has_get_pointer_::any); - -#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -namespace has_get_pointer_ -{ -#endif - - typedef char(&yes)[1]; - typedef char(&no)[2]; - - no check(tag); - template<class T> - yes check(T const&); - - template<class T> - struct impl - { - BOOST_STATIC_CONSTANT(bool, value = sizeof( - check( (get_pointer(*(T*)0),0) )) == sizeof(yes) - ); - - typedef boost::mpl::bool_<value> type; - }; - -} // namespace has_get_pointer_ - -template<class T> -struct has_get_pointer - : has_get_pointer_::impl<T>::type -{}; - -} // namespace luabind - -struct Y -{ -}; - -#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -namespace luabind -{ -#endif - template<class T> - void get_pointer(X<T> const&) - { - ///return (T*)0; - } -#ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP -} // namespace luabind -#endif - -#include <boost/static_assert.hpp> - -int main() -{ - X<int> x; - int* y; - boost::shared_ptr<int> z; - - using namespace luabind; - - //get_pointer(y); -// get_pointer(x); - - BOOST_STATIC_ASSERT((luabind::has_get_pointer<int>::value == 0)); - BOOST_STATIC_ASSERT((luabind::has_get_pointer<X<int> >::value == 1)); - BOOST_STATIC_ASSERT((luabind::has_get_pointer<boost::shared_ptr<int> >::value == 1)); - - return 0; -} - -#endif |