Skip to content

Commit 9ceb9c0

Browse files
committed
Remove BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Process #ifdef...#else...#endif blocks. [SVN r86246]
1 parent 97f9a10 commit 9ceb9c0

4 files changed

Lines changed: 0 additions & 101 deletions

File tree

include/boost/python/detail/value_is_xxx.hpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,6 @@
99
# include <boost/mpl/bool.hpp>
1010
# include <boost/preprocessor/enum_params.hpp>
1111

12-
# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
13-
# include <boost/type_traits/is_reference.hpp>
14-
# include <boost/type_traits/add_reference.hpp>
15-
16-
# define BOOST_PYTHON_VALUE_IS_XXX_DEF(name, qualified_name, nargs) \
17-
template <class X_> \
18-
struct value_is_##name \
19-
{ \
20-
typedef char yes; \
21-
typedef char (&no)[2]; \
22-
\
23-
static typename add_reference<X_>::type dummy; \
24-
\
25-
template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \
26-
static yes test( \
27-
qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) > const&, int \
28-
); \
29-
\
30-
template <class U> \
31-
static no test(U&, ...); \
32-
\
33-
BOOST_STATIC_CONSTANT( \
34-
bool, value \
35-
= (sizeof(test(dummy, 0)) == sizeof(yes))); \
36-
\
37-
typedef mpl::bool_<value> type; \
38-
};
39-
40-
# else
4112

4213
# include <boost/type_traits/remove_reference.hpp>
4314
# include <boost/type_traits/remove_cv.hpp>
@@ -57,6 +28,5 @@ struct value_is_##name \
5728
\
5829
};
5930

60-
# endif
6131

6232
#endif // VALUE_IS_XXX_DWA2003224_HPP

include/boost/python/init.hpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,6 @@ namespace detail
7676
//
7777
// This metaprogram checks if T is an optional
7878
//
79-
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
80-
81-
template <class T>
82-
struct is_optional {
83-
84-
private:
85-
86-
template <BOOST_PYTHON_OVERLOAD_TYPES>
87-
static boost::type_traits::yes_type f(optional<BOOST_PYTHON_OVERLOAD_ARGS>);
88-
static boost::type_traits::no_type f(...);
89-
static T t();
90-
91-
public:
92-
93-
BOOST_STATIC_CONSTANT(
94-
bool, value =
95-
sizeof(f(t())) == sizeof(::boost::type_traits::yes_type));
96-
typedef mpl::bool_<value> type;
97-
};
98-
99-
#else
10079

10180
template <class T>
10281
struct is_optional
@@ -108,7 +87,6 @@ namespace detail
10887
: mpl::true_
10988
{};
11089

111-
#endif
11290

11391
template <int NDefaults>
11492
struct define_class_init_helper;

include/boost/python/object/iterator.hpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -71,35 +71,7 @@ struct iterator_range
7171
# endif
7272
};
7373

74-
# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
75-
// for compilers which can't deduce the value_type of pointers, we
76-
// have a special implementation of next. This takes advantage of
77-
// the fact that T* results are treated like T& results by
78-
// Boost.Python's function wrappers.
79-
struct next_ptr
80-
{
81-
typedef Iterator result_type;
82-
83-
result_type
84-
operator()(iterator_range<NextPolicies,Iterator>& self)
85-
{
86-
if (self.m_start == self.m_finish)
87-
stop_iteration_error();
88-
return self.m_start++;
89-
}
90-
};
91-
92-
typedef mpl::if_<
93-
is_same<
94-
boost::detail::please_invoke_BOOST_TT_BROKEN_COMPILER_SPEC_on_cv_unqualified_pointee<Iterator>
95-
, typename traits_t::value_type
96-
>
97-
, next_ptr
98-
, next
99-
>::type next_fn;
100-
# else
10174
typedef next next_fn;
102-
# endif
10375

10476
object m_sequence; // Keeps the sequence alive while iterating.
10577
Iterator m_start;

include/boost/python/object_core.hpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -206,34 +206,13 @@ namespace api
206206
PyObject* m_ptr;
207207
};
208208

209-
# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
210-
template <class T, class U>
211-
struct is_derived_impl
212-
{
213-
static T x;
214-
template <class X>
215-
static X* to_pointer(X const&);
216-
217-
static char test(U const*);
218-
typedef char (&no)[2];
219-
static no test(...);
220-
221-
BOOST_STATIC_CONSTANT(bool, value = sizeof(test(to_pointer(x))) == 1);
222-
};
223-
224-
template <class T, class U>
225-
struct is_derived
226-
: mpl::bool_<is_derived_impl<T,U>::value>
227-
{};
228-
# else
229209
template <class T, class U>
230210
struct is_derived
231211
: is_convertible<
232212
typename remove_reference<T>::type*
233213
, U const*
234214
>
235215
{};
236-
# endif
237216

238217
template <class T>
239218
typename objects::unforward_cref<T>::type do_unforward_cref(T const& x)

0 commit comments

Comments
 (0)