Skip to content

Commit 315c3d5

Browse files
committed
Apply missing elements of previously-"applied" bug fix.
[SVN r35421]
1 parent d521997 commit 315c3d5

2 files changed

Lines changed: 9 additions & 24 deletions

File tree

include/boost/python/detail/unwrap_wrapper.hpp

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,28 @@
66

77
# include <boost/python/detail/prefix.hpp>
88
# include <boost/python/detail/is_wrapper.hpp>
9-
# if defined(BOOST_PYTHON_NO_SFINAE)
10-
# include <boost/mpl/eval_if.hpp>
11-
# include <boost/mpl/identity.hpp>
12-
# else
13-
# include <boost/python/detail/enable_if.hpp>
14-
# endif
9+
# include <boost/mpl/eval_if.hpp>
10+
# include <boost/mpl/identity.hpp>
1511

1612
namespace boost { namespace python { namespace detail {
1713

18-
# if defined(BOOST_PYTHON_NO_SFINAE)
1914
template <class T>
2015
struct unwrap_wrapper_helper
2116
{
2217
typedef typename T::_wrapper_wrapped_type_ type;
2318
};
24-
25-
template <class T>
26-
typename mpl::eval_if<is_wrapper<T>,unwrap_wrapper_helper<T>,mpl::identity<T> >::type*
27-
unwrap_wrapper(T*)
28-
{
29-
return 0;
30-
}
31-
# else
19+
3220
template <class T>
33-
typename disable_if_ret<is_wrapper<T>,T*>::type
34-
unwrap_wrapper(T*)
35-
{
36-
return 0;
37-
}
21+
struct unwrap_wrapper_
22+
: mpl::eval_if<is_wrapper<T>,unwrap_wrapper_helper<T>,mpl::identity<T> >
23+
{};
3824

3925
template <class T>
40-
T* unwrap_wrapper(wrapper<T>*)
26+
typename unwrap_wrapper_<T>::type*
27+
unwrap_wrapper(T*)
4128
{
4229
return 0;
4330
}
44-
# endif
4531

4632
}}} // namespace boost::python::detail
4733

include/boost/python/operators.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# include <boost/python/other.hpp>
1919
# include <boost/lexical_cast.hpp>
2020
# include <boost/python/refcount.hpp>
21+
# include <boost/python/detail/unwrap_wrapper.hpp>
2122
# include <string>
2223
# include <complex>
2324

@@ -346,7 +347,6 @@ BOOST_PYTHON_UNARY_OPERATOR(long, PyLong_FromLong, long_)
346347
BOOST_PYTHON_UNARY_OPERATOR(float, double, float_)
347348
BOOST_PYTHON_UNARY_OPERATOR(complex, std::complex<double>, complex_)
348349
BOOST_PYTHON_UNARY_OPERATOR(str, lexical_cast<std::string>, str)
349-
BOOST_PYTHON_UNARY_OPERATOR(repr, lexical_cast<std::string>, repr)
350350
# undef BOOST_PYTHON_UNARY_OPERATOR
351351

352352
}} // namespace boost::python
@@ -358,7 +358,6 @@ using boost::python::self_ns::long_;
358358
using boost::python::self_ns::float_;
359359
using boost::python::self_ns::complex_;
360360
using boost::python::self_ns::str;
361-
using boost::python::self_ns::repr;
362361
using boost::python::self_ns::pow;
363362
# endif
364363

0 commit comments

Comments
 (0)