Boost logo

Boost :

From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-10-06 12:40:44


--- Eric Friedman <ebf_at_[hidden]> wrote:

> > Does variant have storage allocation policies?
> > It doesn't seem to have it.
>
> No, it doesn't. In general, storage is on the stack.

Sorry it is not completely clear to me.

If I say:

struct my_type
{
...
};

typedef boost::variant< my_type > my_v;
std::vector< my_v, my_allocator<my_v> > v;

f()
{
   my_type t;
   v.push_back( t );
}

How does the my_type variable gets allocated when it is transferred
to the variant?

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