|
Boost Users : |
Subject: Re: [Boost-users] boost::exception_detail::error_info_base does not have virtual destructor
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2011-03-18 12:06:01
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Friday, March 18, 2011, Ted Byers wrote:
> Or is it the case that extra intelligence has been adde to
> boost::shared_ptr, et al, so that if you create a
> boost::shared_ptr<base_type>, and pass it a pointer to derived type, it
> remembers the type of the original pointer (and maintains that memory
> across copy/assignment), and does the right thing when the object is to
> be freed?
Yes.
> But I'd be curious as to why and how that would have been
> added, and when, when virtual functions acomplish the same thing with no
> extra effort or pain.
Not all base classes need have any virtual functions at all. See
enable_shared_from_this for example.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAk2DgukACgkQ5vihyNWuA4XOtQCg43GLABPUtHZR6tsjw/a4nwCw
D24AnAn/BHprFMk9Wo8cLObX3JxV6GLp
=BYwl
-----END PGP SIGNATURE-----
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net