2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-23 05:42:30 +00:00

Workaround for vc7 bug (and regression test)

[SVN r17708]
This commit is contained in:
Dave Abrahams
2003-03-03 17:21:30 +00:00
parent 577f58149c
commit d028a60cc2
2 changed files with 12 additions and 1 deletions

View File

@@ -12,6 +12,7 @@
# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
# include <boost/type_traits/is_reference.hpp>
# include <boost/type_traits/add_reference.hpp>
# define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \
template <class X_> \
@@ -20,7 +21,7 @@ struct is_##name \
typedef char yes; \
typedef char (&no)[2]; \
\
static X_ dummy; \
static typename add_reference<X_>::type dummy; \
\
template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \
static yes test( \

View File

@@ -20,8 +20,18 @@ int x_value(X const& x)
X make_x(int n) { return X(n); }
// foo/bar -- a regression for a vc7 bug workaround
struct bar {};
struct foo
{
virtual void f() = 0;
operator bar() const { return bar(); }
};
BOOST_PYTHON_MODULE(implicit_ext)
{
implicitly_convertible<foo,bar>();
implicitly_convertible<int,X>();
def("x_value", x_value);