// Copyright David Abrahams 2002. Permission to copy, use, // modify, sell and distribute this software is granted provided this // copyright notice appears in all copies. This software is provided // "as is" without express or implied warranty, and with no claim as // to its suitability for any purpose. #include #include #include #include #include #include #include #define BOOST_INCLUDE_MAIN #include struct BR {}; struct Base {}; struct Derived : Base {}; namespace boost { namespace python { // specialization template <> struct has_back_reference
{ BOOST_STATIC_CONSTANT(bool, value = true); }; }} // namespace boost::python template void assert_same(U* = 0, T* = 0) { BOOST_TEST((boost::is_same::value)); BOOST_STATIC_ASSERT((boost::is_same::value)); } template void assert_holder(T* = 0, Held* = 0, Holder* = 0) { assert_same( #if BOOST_WORKAROUND(__MWERKS__, <= 0x2407) boost::python::objects::select_holder::execute((Held*)0).get() #else boost::python::objects::select_holder::type::get() #endif ); } int test_main(int, char * []) { using namespace boost::python::detail; using namespace boost::python::objects; assert_holder >(); assert_holder >(); assert_holder >(); assert_holder >(); assert_holder >(); assert_holder ,pointer_holder,Base> >(); assert_holder ,pointer_holder_back_reference,Base> >(); assert_holder ,pointer_holder_back_reference,BR> > (); return 0; } #if !defined(_WIN32) || defined(__GNUC__) // This definition is needed for MinGW 2.95.2 and KCC on OSF for some // reason, but will break other Win32 compilers. namespace boost { namespace python { bool handle_exception_impl(boost::function0) { return false; } }} #endif