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

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Fri Aug 8 19:59:57 CEST 2003


>>>>> "DA" == David Abrahams <dave at boost-consulting.com> writes:

    >> 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!

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

Thats nice!

    >> 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)
    >> So is this a bug or am I or Pyste doing something wrong?

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

It has been about a month since I touched this code and back then,
IIRC, it was working fine.  I had a small example that I was using to
experiment with std::auto_ptr.  From what I can remember it worked
then.  That was a while back and I might have made some kind of
mistake or perhaps not tested it carefully enough.  One possibility is
that I tested it with a class that had no virtual functions and
therefore no wrapper class.  Unfortunately, I'm unable to find any
hard evidence.  Its most likely that I didn't test carefully enough.

Anyway, from your response I understand that for classes with virtual
functions I need the add_wrapper function to use
std::auto_ptr<A_Wrapper> and not std::auto_ptr<A>.  This is a bit of a
pain with Pyste since if Nicodemus changes the name of the wrapper
class I'd have to change the pyste files.  Its easy to get things
working now since I know how the wrapper classes are named.  Is there
an alternative way to do this that insulates the user from future
changes to the wrapper name?

Thanks and sorry for the false alarm.


More information about the Cplusplus-sig mailing list