@@ -170,60 +170,12 @@ namespace detail
170170
171171// select_holder<T,Held>::execute((Held*)0)
172172//
173- // implements a compile-time returns an instantiation of
173+ // Returns an instantiation of
174174// detail::select_value_holder or detail::select_pointer_holder, as
175175// appropriate for class_<T,Held>
176176template <class T , class Held >
177177struct select_holder
178- {
179- // Return the additional size to allocate in Python class
180- // instances to hold the C++ instance data.
181- static inline std::size_t additional_size ()
182- {
183- return additional_size_helper (
184- # if BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
185- execute ((Held*)0 )
186- # else
187- type ()
188- # endif
189- );
190- }
191-
192- # if BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
193- // These overloads are an elaborate workaround for deficient
194- // compilers:
195- //
196- // They are meant to be called with a null pointer to the class_'s
197- // Held template argument. The selected overload will create an
198- // appropriate instantiation of select_value_holder or
199- // select_pointer_holder, which is itself an empty class that is
200- // ultimately used to create the class_'s instance_holder subclass
201- // object.
202-
203- // No Held was specified; T is held directly by-value
204- static inline detail::select_value_holder<T,T>
205- execute (python::detail::not_specified*)
206- {
207- return detail::select_value_holder<T,T>();
208- }
209-
210- // A type derived from T was specified; it is assumed to be a
211- // virtual function dispatcher class, and T is held as Held.
212- static inline detail::select_value_holder<T, Held>
213- execute (T*)
214- {
215- return detail::select_value_holder<T, Held>();
216- }
217-
218- // Some other type was specified; Held is assumed to be a (smart)
219- // pointer to T or a class derived from T.
220- static inline detail::select_pointer_holder<T,Held>
221- execute (void *)
222- {
223- return detail::select_pointer_holder<T,Held>();
224- }
225- # else
226- typedef typename mpl::if_<
178+ : mpl::if_<
227179 is_same<Held, python::detail::not_specified>
228180 , detail::select_value_holder<T,T>
229181 , typename mpl::if_<
@@ -234,16 +186,8 @@ struct select_holder
234186 , detail::select_value_holder<T,Held>
235187 , detail::select_pointer_holder<T, Held>
236188 >::type
237- >::type type;
238- # endif
239-
240- private:
241- template <class Selector >
242- static inline std::size_t additional_size_helper (Selector const &)
243- {
244- typedef typename Selector::type holder;
245- return additional_instance_size<holder>::value;
246- }
189+ >::type
190+ {
247191};
248192
249193}}} // namespace boost::python::objects
0 commit comments