[future] exception_ptr bug

I think the _exp_throwable class in Peter's prototype implementation of exception_ptr needs its destructor to be declared virtual. -- Frank

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 15 March 2007 13:23 pm, Peter Dimov wrote:
Frank Mori Hess wrote:
I think the _exp_throwable class in Peter's prototype implementation of exception_ptr needs its destructor to be declared virtual.
I don't think so. :-)
I don't understand. Won't the exception_ptr deleter delete _exp_throwable_impl objects through base class _exp_throwable pointers? Is there some magic here I'm missing? - -- Frank -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFF+YSm5vihyNWuA4URAlOaAKDFvty6+RCfroahdltwRlyT6ag2LQCg6Fri M0Ug8FBPw+mN7VACO+XqNAk= =NlMp -----END PGP SIGNATURE-----

Frank Mori Hess wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thursday 15 March 2007 13:23 pm, Peter Dimov wrote:
Frank Mori Hess wrote:
I think the _exp_throwable class in Peter's prototype implementation of exception_ptr needs its destructor to be declared virtual.
I don't think so. :-)
I don't understand. Won't the exception_ptr deleter delete _exp_throwable_impl objects through base class _exp_throwable pointers?
No. If you try to delete an _exp_throwable*, you'll see that the protected destructor won't allow that.
Is there some magic here I'm missing?
Yes. The magic is inside shared_ptr<T>. It deletes whatever is passed to its constructor, regardless of T, which can even be incomplete (as in this case) or void.
participants (2)
-
Frank Mori Hess
-
Peter Dimov