|
Boost Users : |
Subject: Re: [Boost-users] Flyweight: wrapping shared_ptr
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2014-10-08 16:21:21
Joaquin M Lopez Munoz <joaquin <at> tid.es> writes:
>
> Wow, this is totally verboten. The following problems lurk:
>
> [...]
>
> 3. Even if #2 holds, the thing would work by pure chance (basically,
> because a "casted" poly_flyweight<Base> happens never to touch
> the internal factory of poly_flyweight<Derived>, which in principle
> a conformant implementation is allowed to do).
In fact, the invalid scenario can happen at flyweight destruction time.
See the program crash at:
http://coliru.stacked-crooked.com/a/3180b67524a49b75
JoaquÃn M López Muñoz
Telefónica
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