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
> 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?


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