
On 10/21/07, Sebastian Redl <sebastian.redl@getdesigned.at> wrote:
The problem with small object optimization is that you get the same issue that boost.variant has: it's hard to maintain the never-empty guarantee in operator=, Neither Boost.Any nor this optional_poly have a never-empty guarantee,
Mathias Gaunard wrote: though. Which makes = a lot easier, if you're satisfied with the Basic Guarantee. On the other hand, a poly would need a never-empty guarantee, thus making an optional<poly> much more complex than an optional_poly.
This is exactly the reason that made me start from optional_poly. It is a lot simpler to implement, with just basic exception safety guarantee. Anyway, optional_poly has strong exception safety guarantee for swap, so I think I could leverage it to implement poly<T> (with a larger overhead, and losing some opportunities to perform the small object optimization). Sebastian Redl
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- __________________________________________________________________________ dott. Corrado Zoccolo mailto:zoccolo@di.unipi.it PhD - Department of Computer Science - University of Pisa, Italy --------------------------------------------------------------------------