Skip to content

Commit 13b16f9

Browse files
committed
Workarounds for vc6 and 7.
[SVN r28958]
1 parent 82563df commit 13b16f9

2 files changed

Lines changed: 23 additions & 38 deletions

File tree

include/boost/python/converter/arg_from_python.hpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@ struct back_reference_arg_from_python
148148

149149
template <class C, class T, class F>
150150
struct if_2
151-
: mpl::eval_if<C, mpl::identity<T>, F>
152-
{};
151+
{
152+
typedef typename mpl::eval_if<C, mpl::identity<T>, F>::type type;
153+
};
153154

154155
// This metafunction selects the appropriate arg_from_python converter
155156
// type for an argument of type T.
@@ -176,18 +177,18 @@ struct select_arg_from_python
176177
mpl::or_<
177178
indirect_traits::is_reference_to_non_const<T>
178179
, indirect_traits::is_reference_to_volatile<T>
179-
>
180-
, reference_arg_from_python<T>
181-
, mpl::if_<
182-
boost::python::is_back_reference<T>
183-
, back_reference_arg_from_python<T>
184-
, arg_rvalue_from_python<T>
185-
>
186-
>
187-
>
188-
>
189-
>
190-
>::type type;
180+
>
181+
, reference_arg_from_python<T>
182+
, mpl::if_<
183+
boost::python::is_back_reference<T>
184+
, back_reference_arg_from_python<T>
185+
, arg_rvalue_from_python<T>
186+
>
187+
>
188+
>
189+
>
190+
>
191+
>::type type;
191192
};
192193

193194
// ==================

include/boost/python/converter/registered.hpp

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# include <boost/type_traits/transform_traits.hpp>
1111
# include <boost/type_traits/cv_traits.hpp>
1212
# include <boost/detail/workaround.hpp>
13-
# include <boost/type.hpp>
1413

1514
namespace boost {
1615

@@ -59,49 +58,34 @@ struct registered<T&>
5958
namespace detail
6059
{
6160
inline void
62-
register_shared_ptr(...)
61+
register_shared_ptr0(...)
6362
{
6463
}
6564

6665
template <class T>
6766
inline void
68-
register_shared_ptr(type<shared_ptr<T> >)
67+
register_shared_ptr0(shared_ptr<T>*)
6968
{
7069
registry::lookup_shared_ptr(type_id<shared_ptr<T> >());
7170
}
7271

7372
template <class T>
7473
inline void
75-
register_shared_ptr(type<shared_ptr<T> const>)
74+
register_shared_ptr1(T const volatile*)
7675
{
77-
detail::register_shared_ptr(type<shared_ptr<T> >());
78-
}
79-
80-
template <class T>
81-
inline void
82-
register_shared_ptr(type<shared_ptr<T> volatile>)
83-
{
84-
detail::register_shared_ptr(type<shared_ptr<T> >());
85-
}
86-
87-
template <class T>
88-
inline void
89-
register_shared_ptr(type<shared_ptr<T> const volatile>)
90-
{
91-
detail::register_shared_ptr(type<shared_ptr<T> >());
76+
detail::register_shared_ptr0((T*)0);
9277
}
9378

9479
template <class T>
9580
registration const&
96-
registry_lookup(type<T&>)
81+
registry_lookup(T&(*)())
9782
{
98-
detail::register_shared_ptr(type<T>());
83+
detail::register_shared_ptr1((T*)0);
9984
return registry::lookup(type_id<T>());
10085
}
101-
86+
10287
template <class T>
103-
registration const& registered_base<T>::converters
104-
= detail::registry_lookup(type<T>());
88+
registration const& registered_base<T>::converters = detail::registry_lookup((T(*)())0);
10589
}
10690

10791
}}} // namespace boost::python::converter

0 commit comments

Comments
 (0)