[C++-sig] Re: MEMBER_FUNCTION_OVERLOADS doesn't honor virtualness

Jonathan Brandmeyer jbrandmeyer at earthlink.net
Mon Nov 1 12:07:30 CET 2004

On Sun, 2004-10-31 at 23:10 -0500, David Abrahams wrote:
> Jonathan Brandmeyer <jbrandmeyer at earthlink.net> writes:
> > The subject says it all.  Attached is a test case.
> >

> > BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS( print_me, base::print_me, 0, 1)
> This won't compile without an ampersand-------------^

Are you sure?  For me (GCC 3.3.4), it doesn't compile with the
address-of operator.  Tests in libs/python/test/keywords.cpp and
libs/python/test/args.cpp do not use the ampersand.

> What result are you expecting from this?  Can you rewrite the example
> so that it asserts when you don't get the expected result.

Sure.  I have attached a replacement for the Python file.  The problem
is that derived.print_me() prints "base: " some_number, when I expect to
get "derived: " some_number.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: idontwork.py
Type: application/x-python
Size: 433 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20041101/4d77c9f1/attachment.bin>

More information about the Cplusplus-sig mailing list