8 Oct
2014
8 Oct
'14
8:21 p.m.
Joaquin M Lopez Munoz
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