Boost logo

Boost :

Subject: Re: [boost] Interest in a "Heterogenous Container" system?
From: Scott McMurray ([hidden])
Date: 2009-06-28 20:13:27

2009/6/28 Christian Schladetsch <christian.schladetsch_at_[hidden]>:
> On Mon, Jun 29, 2009 at 12:58 PM, Robert Ramey <ramey_at_[hidden]> wrote:
>> How is this different from a container of <boost/variant.hpp>
> boost::variant doesnt support custom allocators. it uses naked new and
> delete.

A quick test with geordi suggests that it uses placement new, not naked new:

<> geordi, { unique_ptr<tracked::B> p(new tracked::B); }
<geordi> new(B) B0* B0~ delete(B0)
<> geordi, { boost::variant<tracked::B> v; v = tracked::B(); }
<geordi> B0* B1* B0=B1 B1~ B0~

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