Skip to content

Commit d02959e

Browse files
committed
Remove cwpro7 workarounds; simplified select_holder
[SVN r19772]
1 parent b844d8b commit d02959e

2 files changed

Lines changed: 5 additions & 70 deletions

File tree

include/boost/python/init.hpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -328,23 +328,14 @@ namespace detail
328328
, detail::keyword_range const& keywords_
329329
)
330330
{
331-
typedef typename ClassT::holder_selector holder_selector_t;
332-
# if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
333-
typedef typename holder_selector_t::type selector_t;
334-
# endif
335-
typedef typename ClassT::held_type held_type_t;
331+
typedef typename ClassT::select_holder selector_t;
336332

337333
cl.def(
338334
"__init__",
339335
detail::make_keyword_range_constructor<Signature,NArgs>(
340336
policies
341337
, keywords_
342-
# if BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
343-
// Using runtime type selection works around a CWPro7 bug.
344-
, holder_selector_t::execute((held_type_t*)0).get()
345-
# else
346338
, selector_t::get()
347-
# endif
348339
)
349340
, doc
350341
);

include/boost/python/object/select_holder.hpp

Lines changed: 4 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -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>
176176
template <class T, class Held>
177177
struct 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

Comments
 (0)