Boost logo

Boost :

From: Corrado Zoccolo (czoccolo_at_[hidden])
Date: 2007-11-01 11:49:29

I've uploaded a new version of the library in the vault: **
It now provides also a new class (poly<T>) that maintains the never-empty
poly<T> and optional_poly<T> share a large part of their implementation, so
I think it is sound to have both in the same library.

On 10/22/07, Steven Watanabe <steven_at_[hidden]> wrote:
> When I was trying to do this I only used the small
> object optimization for types that I knew to have a no-throw
> copy constructor (i.e. builtin types at the moment). In C++Ox
> this can be loosened to having a no-throw move constructor.

My solution is more aggressive, allowing more optimization opportunities.
Basically, if an object is small, it will be always stored in the small
buffer when the poly is constructed.
It will be allocated on heap only when the guarantee is at stake, e.g.
during a swap between types that both lack a no-throw copy (it is sufficient
that one of them have the no throw copy to avoid this allocation).
Assignment operator is implemented by means of swap, so the same applies to

I would like to take advantage also of movable types in the implementation
of swap, so I'd like to see a move library submitted to boost.


dott. Corrado Zoccolo                          mailto:zoccolo_at_[hidden]
PhD - Department of Computer Science - University of Pisa, Italy

Boost list run by bdawes at, gregod at, cpdaniel at, john at