Skip to content

Commit 97f9a10

Browse files
committed
Remove BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Process #ifndef...#else...#endif blocks. [SVN r86245]
1 parent 87f776b commit 97f9a10

File tree

12 files changed

+0
-482
lines changed

12 files changed

+0
-482
lines changed

include/boost/python/args.hpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ namespace detail
102102
return this->operator,(python::arg(name));
103103
}
104104

105-
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
106105
template<typename T>
107106
struct is_keywords
108107
{
@@ -126,31 +125,6 @@ namespace detail
126125
typedef mpl::bool_<value> type;
127126
BOOST_PYTHON_MPL_LAMBDA_SUPPORT(1,is_reference_to_keywords,(T))
128127
};
129-
# else
130-
typedef char (&yes_keywords_t)[1];
131-
typedef char (&no_keywords_t)[2];
132-
133-
no_keywords_t is_keywords_test(...);
134-
135-
template<std::size_t nkeywords>
136-
yes_keywords_t is_keywords_test(void (*)(keywords<nkeywords>&));
137-
138-
template<std::size_t nkeywords>
139-
yes_keywords_t is_keywords_test(void (*)(keywords<nkeywords> const&));
140-
141-
template<typename T>
142-
class is_reference_to_keywords
143-
{
144-
public:
145-
BOOST_STATIC_CONSTANT(
146-
bool, value = (
147-
sizeof(detail::is_keywords_test( (void (*)(T))0 ))
148-
== sizeof(detail::yes_keywords_t)));
149-
150-
typedef mpl::bool_<value> type;
151-
BOOST_PYTHON_MPL_LAMBDA_SUPPORT(1,is_reference_to_keywords,(T))
152-
};
153-
# endif
154128
}
155129

156130
inline detail::keywords<1> args(char const* name)

include/boost/python/back_reference.hpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ struct back_reference
2929
T m_value;
3030
};
3131

32-
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
3332
template<typename T>
3433
class is_back_reference
3534
{
@@ -44,36 +43,6 @@ class is_back_reference<back_reference<T> >
4443
BOOST_STATIC_CONSTANT(bool, value = true);
4544
};
4645

47-
# else // no partial specialization
48-
49-
}} // namespace boost::python
50-
51-
#include <boost/type.hpp>
52-
53-
namespace boost { namespace python {
54-
55-
namespace detail
56-
{
57-
typedef char (&yes_back_reference_t)[1];
58-
typedef char (&no_back_reference_t)[2];
59-
60-
no_back_reference_t is_back_reference_test(...);
61-
62-
template<typename T>
63-
yes_back_reference_t is_back_reference_test(boost::type< back_reference<T> >);
64-
}
65-
66-
template<typename T>
67-
class is_back_reference
68-
{
69-
public:
70-
BOOST_STATIC_CONSTANT(
71-
bool, value = (
72-
sizeof(detail::is_back_reference_test(boost::type<T>()))
73-
== sizeof(detail::yes_back_reference_t)));
74-
};
75-
76-
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
7746

7847
//
7948
// implementations

include/boost/python/bases.hpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ namespace boost { namespace python {
2424

2525
namespace detail
2626
{
27-
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
2827
template <class T> struct specifies_bases
2928
: mpl::false_
3029
{
@@ -35,23 +34,6 @@ namespace boost { namespace python {
3534
: mpl::true_
3635
{
3736
};
38-
# else
39-
template < BOOST_PP_ENUM_PARAMS(BOOST_PYTHON_MAX_BASES, class Base) >
40-
static char is_bases_helper(bases< BOOST_PYTHON_BASE_PARAMS > const&);
41-
42-
static char (& is_bases_helper(...) )[256];
43-
44-
template <class T>
45-
struct specifies_bases
46-
{
47-
private:
48-
static typename add_reference<T>::type make();
49-
BOOST_STATIC_CONSTANT(bool, non_ref = !is_reference<T>::value);
50-
public:
51-
BOOST_STATIC_CONSTANT(bool, value = non_ref & (sizeof(is_bases_helper(make())) == 1));
52-
typedef mpl::bool_<value> type;
53-
};
54-
# endif
5537
template <class T, class Prev = bases<> >
5638
struct select_bases
5739
: mpl::if_<

include/boost/python/converter/object_manager.hpp

100755100644
Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ struct is_object_manager
121121
{
122122
};
123123

124-
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
125124
template <class T>
126125
struct is_reference_to_object_manager
127126
: mpl::false_
@@ -151,79 +150,6 @@ struct is_reference_to_object_manager<T const volatile&>
151150
: is_object_manager<T>
152151
{
153152
};
154-
# else
155-
156-
namespace detail
157-
{
158-
typedef char (&yes_reference_to_object_manager)[1];
159-
typedef char (&no_reference_to_object_manager)[2];
160-
161-
// A number of nastinesses go on here in order to work around MSVC6
162-
// bugs.
163-
template <class T>
164-
struct is_object_manager_help
165-
{
166-
typedef typename mpl::if_<
167-
is_object_manager<T>
168-
, yes_reference_to_object_manager
169-
, no_reference_to_object_manager
170-
>::type type;
171-
172-
// If we just use the type instead of the result of calling this
173-
// function, VC6 will ICE.
174-
static type call();
175-
};
176-
177-
// A set of overloads for each cv-qualification. The same argument
178-
// is passed twice: the first one is used to unwind the cv*, and the
179-
// second one is used to avoid relying on partial ordering for
180-
// overload resolution.
181-
template <class U>
182-
typename is_object_manager_help<U>
183-
is_object_manager_helper(U*, void*);
184-
185-
template <class U>
186-
typename is_object_manager_help<U>
187-
is_object_manager_helper(U const*, void const*);
188-
189-
template <class U>
190-
typename is_object_manager_help<U>
191-
is_object_manager_helper(U volatile*, void volatile*);
192-
193-
template <class U>
194-
typename is_object_manager_help<U>
195-
is_object_manager_helper(U const volatile*, void const volatile*);
196-
197-
template <class T>
198-
struct is_reference_to_object_manager_nonref
199-
: mpl::false_
200-
{
201-
};
202-
203-
template <class T>
204-
struct is_reference_to_object_manager_ref
205-
{
206-
static T sample_object;
207-
BOOST_STATIC_CONSTANT(
208-
bool, value
209-
= (sizeof(is_object_manager_helper(&sample_object, &sample_object).call())
210-
== sizeof(detail::yes_reference_to_object_manager)
211-
)
212-
);
213-
typedef mpl::bool_<value> type;
214-
};
215-
}
216-
217-
template <class T>
218-
struct is_reference_to_object_manager
219-
: mpl::if_<
220-
is_reference<T>
221-
, detail::is_reference_to_object_manager_ref<T>
222-
, detail::is_reference_to_object_manager_nonref<T>
223-
>::type
224-
{
225-
};
226-
# endif
227153

228154
}}} // namespace boost::python::converter
229155

include/boost/python/converter/registered_pointee.hpp

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ namespace boost { namespace python { namespace converter {
1414

1515
struct registration;
1616

17-
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
1817
template <class T>
1918
struct registered_pointee
2019
: registered<
@@ -26,37 +25,6 @@ struct registered_pointee
2625
>
2726
{
2827
};
29-
# else
30-
namespace detail
31-
{
32-
template <class T>
33-
struct registered_pointee_base
34-
{
35-
static registration const& converters;
36-
};
37-
}
38-
39-
template <class T>
40-
struct registered_pointee
41-
: detail::registered_pointee_base<
42-
typename add_reference<
43-
typename add_cv<T>::type
44-
>::type
45-
>
46-
{
47-
};
48-
49-
//
50-
// implementations
51-
//
52-
namespace detail
53-
{
54-
template <class T>
55-
registration const& registered_pointee_base<T>::converters
56-
= registry::lookup(pointer_type_id<T>());
57-
}
58-
59-
# endif
6028
}}} // namespace boost::python::converter
6129

6230
#endif // REGISTERED_POINTEE_DWA2002710_HPP

include/boost/python/detail/borrowed_ptr.hpp

100755100644
Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ template<class T> class borrowed
1919
typedef T type;
2020
};
2121

22-
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
2322
template<typename T>
2423
struct is_borrowed_ptr
2524
{
@@ -68,35 +67,6 @@ struct is_borrowed_ptr<T*>
6867
};
6968
# endif
7069

71-
# else // no partial specialization
72-
73-
typedef char (&yes_borrowed_ptr_t)[1];
74-
typedef char (&no_borrowed_ptr_t)[2];
75-
76-
no_borrowed_ptr_t is_borrowed_ptr_test(...);
77-
78-
template <class T>
79-
typename mpl::if_c<
80-
is_pointer<T>::value
81-
, T
82-
, int
83-
>::type
84-
is_borrowed_ptr_test1(boost::type<T>);
85-
86-
template<typename T>
87-
yes_borrowed_ptr_t is_borrowed_ptr_test(borrowed<T> const volatile*);
88-
89-
template<typename T>
90-
class is_borrowed_ptr
91-
{
92-
public:
93-
BOOST_STATIC_CONSTANT(
94-
bool, value = (
95-
sizeof(detail::is_borrowed_ptr_test(is_borrowed_ptr_test1(boost::type<T>())))
96-
== sizeof(detail::yes_borrowed_ptr_t)));
97-
};
98-
99-
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
10070

10171
}
10272

include/boost/python/detail/referent_storage.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ union aligned_storage
4242
// but sizeof() is broken in CodeWarriors <= 8.0
4343
template <class T> struct referent_size;
4444

45-
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
4645

4746
template <class T>
4847
struct referent_size<T&>
@@ -51,15 +50,6 @@ union aligned_storage
5150
std::size_t, value = sizeof(T));
5251
};
5352

54-
# else
55-
56-
template <class T> struct referent_size
57-
{
58-
static T f();
59-
BOOST_STATIC_CONSTANT(std::size_t, value = sizeof(f()));
60-
};
61-
62-
# endif
6353

6454
// A metafunction returning a POD type which can store U, where T ==
6555
// U&. If T is not a reference type, returns a POD which can store T.

include/boost/python/detail/string_literal.hpp

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
namespace boost { namespace python { namespace detail {
1616

17-
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
1817
template <class T>
1918
struct is_string_literal : mpl::false_
2019
{
@@ -45,43 +44,6 @@ struct is_string_literal<T[n]>
4544
{
4645
};
4746
# endif
48-
# else
49-
template <bool is_array = true>
50-
struct string_literal_helper
51-
{
52-
typedef char (&yes_string_literal)[1];
53-
typedef char (&no_string_literal)[2];
54-
55-
template <class T>
56-
struct apply
57-
{
58-
typedef apply<T> self;
59-
static T x;
60-
static yes_string_literal check(char const*);
61-
static no_string_literal check(char*);
62-
static no_string_literal check(void const volatile*);
63-
64-
BOOST_STATIC_CONSTANT(
65-
bool, value = sizeof(self::check(x)) == sizeof(yes_string_literal));
66-
typedef mpl::bool_<value> type;
67-
};
68-
};
69-
70-
template <>
71-
struct string_literal_helper<false>
72-
{
73-
template <class T>
74-
struct apply : mpl::false_
75-
{
76-
};
77-
};
78-
79-
template <class T>
80-
struct is_string_literal
81-
: string_literal_helper<is_array<T>::value>::apply<T>
82-
{
83-
};
84-
# endif
8547

8648
}}} // namespace boost::python::detail
8749

0 commit comments

Comments
 (0)