[C++-sig] Re: Possible bug with HeldType?

David Abrahams dave at boost-consulting.com
Fri Aug 8 18:46:39 CEST 2003

Prabhu Ramachandran <prabhu at aero.iitm.ernet.in> writes:

> This looks correct to my eyes.  However I am unable to do something
> like this in Python:
> In [1]: import holder
> In [2]: a = holder.A()
> In [3]: h = holder.Holder()
> In [4]: h.add(a)
> ArgumentError: Python argument types in
>     Holder.add(Holder, A)
> did not match C++ signature:
>     add(P6Holder, t8auto_ptr1Z1A)
> I could swear that this code used to work fine a month back.  BTW, the
> new traceback is a nice change from the original unhelpful
> RuntimeError, thanks!

Use a more-modern GCC and you'll get real type names in there as well.

> Anyway, I changed:
>   void add_wrapper(Holder* c, std::auto_ptr< A > o)
> to read like so:
>   void add_wrapper(Holder* c, std::auto_ptr< A_Wrapper > o)
> and it runs fine.  I also noticed that if A does not have virtual
> functions and I dont create a wrapper, the code works just fine.
> So is this a bug or am I or Pyste doing something wrong?

It surprises me that you're saying the same C++ code worked a month
ago.  I don't see how that's possible.

Dave Abrahams
Boost Consulting

More information about the Cplusplus-sig mailing list