Boost logo

Boost :

From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-10-06 23:55:07


--- Eric Friedman <ebf_at_[hidden]> wrote:
[...]
> Do you mean you need to ensure allocation of some user-provided type occurs
> only via some user-provided allocator?

Yes.

> If so, variant unfortunately does not
> support such functionality at this time.

Any plans to support it?

> However, as I noted in previous messages, allocation on the heap can be
> avoided entirely for any type Ti in variant<T1, ..., TN> if T1 is nothrow
> default-constructible. I would suggest then that, if none of your types are
> guaranteed to have a nothrow default constructor, you work with
> variant<boost::empty, T1, ..., TN>. Even if you never make direct use of
> boost::empty, this will ensure all allocation will be via placement new and
> never on the heap.

Is there any guarantee that this internal behaviour won't change
in the future?
It is kind of annoying that I can use almost nothing from boost
in my policy based library.
I cannot use boost::shared_ptr, boost::signals;
and boost::variant has a kludgy workaround.
If there are plans to fix it(?), I can live with this kludge for now.
Anyway I like 'variant', thanks for the great library.

Eugene

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk