Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2006-12-15 07:49:47


"John Maddock" <john_at_[hidden]> wrote in message
news:00f001c72029$905cb050$a0331b56_at_fuji...
> Joel de Guzman wrote:

You probably reply to ne.

>>>> I suppose I could have used a vector instead, but it's less elegant
>>>> somehow.
>>>
>>> How the std::vector<boost::variant> is less elegant?
>>>
>>> 1. It's could be implemented in cpp file. Your tuple based solution
>>> is in header right?
>>> 2. It allows dynamically sized entries, so you could skip some of the
>>> default values
>>> 3. It's as fast of could be even faster since we don't need to pass
>>> big structures around
>
> No std::vector does a deep copy (read memory allocation) with every copy.
> That means vector based code would be several orders of magnitude slower
> than passing small-ish tuples up and down the stack.

I am sorry. I don't follow you. Could you write an example?

Gennadiy


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