diff --git a/include/boost/python/init.hpp b/include/boost/python/init.hpp index 0a052166..97da2f3b 100644 --- a/include/boost/python/init.hpp +++ b/include/boost/python/init.hpp @@ -328,23 +328,14 @@ namespace detail , detail::keyword_range const& keywords_ ) { - typedef typename ClassT::holder_selector holder_selector_t; -# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) - typedef typename holder_selector_t::type selector_t; -# endif - typedef typename ClassT::held_type held_type_t; + typedef typename ClassT::select_holder selector_t; cl.def( "__init__", detail::make_keyword_range_constructor( policies , keywords_ -# if BOOST_WORKAROUND(__MWERKS__, <= 0x2407) - // Using runtime type selection works around a CWPro7 bug. - , holder_selector_t::execute((held_type_t*)0).get() -# else , selector_t::get() -# endif ) , doc ); diff --git a/include/boost/python/object/select_holder.hpp b/include/boost/python/object/select_holder.hpp index 3b461edd..11a8c09a 100644 --- a/include/boost/python/object/select_holder.hpp +++ b/include/boost/python/object/select_holder.hpp @@ -170,60 +170,12 @@ namespace detail // select_holder::execute((Held*)0) // -// implements a compile-time returns an instantiation of +// Returns an instantiation of // detail::select_value_holder or detail::select_pointer_holder, as // appropriate for class_ template struct select_holder -{ - // Return the additional size to allocate in Python class - // instances to hold the C++ instance data. - static inline std::size_t additional_size() - { - return additional_size_helper( -# if BOOST_WORKAROUND(__MWERKS__, <= 0x2407) - execute((Held*)0) -# else - type() -# endif - ); - } - - # if BOOST_WORKAROUND(__MWERKS__, <= 0x2407) - // These overloads are an elaborate workaround for deficient - // compilers: - // - // They are meant to be called with a null pointer to the class_'s - // Held template argument. The selected overload will create an - // appropriate instantiation of select_value_holder or - // select_pointer_holder, which is itself an empty class that is - // ultimately used to create the class_'s instance_holder subclass - // object. - - // No Held was specified; T is held directly by-value - static inline detail::select_value_holder - execute(python::detail::not_specified*) - { - return detail::select_value_holder(); - } - - // A type derived from T was specified; it is assumed to be a - // virtual function dispatcher class, and T is held as Held. - static inline detail::select_value_holder - execute(T*) - { - return detail::select_value_holder(); - } - - // Some other type was specified; Held is assumed to be a (smart) - // pointer to T or a class derived from T. - static inline detail::select_pointer_holder - execute(void*) - { - return detail::select_pointer_holder(); - } -# else - typedef typename mpl::if_< + : mpl::if_< is_same , detail::select_value_holder , typename mpl::if_< @@ -234,16 +186,8 @@ struct select_holder , detail::select_value_holder , detail::select_pointer_holder >::type - >::type type; -# endif - - private: - template - static inline std::size_t additional_size_helper(Selector const&) - { - typedef typename Selector::type holder; - return additional_instance_size::value; - } + >::type +{ }; }}} // namespace boost::python::objects