Skip to content

Commit d028a60

Browse files
committed
Workaround for vc7 bug (and regression test)
[SVN r17708]
1 parent 577f581 commit d028a60

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

include/boost/python/detail/is_xxx.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
1414
# include <boost/type_traits/is_reference.hpp>
15+
# include <boost/type_traits/add_reference.hpp>
1516

1617
# define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \
1718
template <class X_> \
@@ -20,7 +21,7 @@ struct is_##name \
2021
typedef char yes; \
2122
typedef char (&no)[2]; \
2223
\
23-
static X_ dummy; \
24+
static typename add_reference<X_>::type dummy; \
2425
\
2526
template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \
2627
static yes test( \

test/implicit.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,18 @@ int x_value(X const& x)
2020

2121
X make_x(int n) { return X(n); }
2222

23+
24+
// foo/bar -- a regression for a vc7 bug workaround
25+
struct bar {};
26+
struct foo
27+
{
28+
virtual void f() = 0;
29+
operator bar() const { return bar(); }
30+
};
31+
2332
BOOST_PYTHON_MODULE(implicit_ext)
2433
{
34+
implicitly_convertible<foo,bar>();
2535
implicitly_convertible<int,X>();
2636

2737
def("x_value", x_value);

0 commit comments

Comments
 (0)