
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 09 April 2008 14:07 pm, Daniel Frey wrote:
On Wed, 2008-04-09 at 13:47 -0400, Frank Mori Hess wrote:
On Wednesday 09 April 2008 11:13 am, Daniel Frey wrote:
I have use cases which would be a lot easier to implement if shared_from_this() never throws. And - at least with the "old" implementation - I don't see any reason why this guarantee should not hold. Of course it's not a defect, but to me it seems desirable.
It is technically possible to make it throw without violating the functions documented requirements, if there are multiple owners. For example, if pass the raw pointer to multiple shared_ptrs with null deleters.
Could you provide a small but complete code example, please? I fail to see how that case should be legal.
Here you go, this throws against the old library. It doesn't against the trunk, due to a slight change in behavior, but could easily be modified to do so. - -- Frank -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFH/Qfu5vihyNWuA4URAgMaAKCpxwhzr7c4wIpxWjOTizCeWLGZaQCeI8jV Ta0uHXG6PRTWMI224Z67WF4= =DOZL -----END PGP SIGNATURE-----