Boost logo

Boost :

From: Joel de Guzman (djowel_at_[hidden])
Date: 2002-11-01 20:54:06


----- Original Message -----
From: "Arkadiy Vertleyb" <vertleyb_at_[hidden]>

>
> There were many times when I PROVED that something can't be done, and then
> actualy did it... Or somebody else did it. :o))

Surely!

> > Another comment is the tuple. I think boost tuples can be used.
> >
>
> Boost tuples allow the access by the position number. To access by name,
> we would have to somehow map the name to the position number. We would
> probably have to use strings to define names, which would elliminate the
> posibility of compile time checks. Also, static_cast should be
> significantly faster than iterating through boost::tuple fields.

I do not agree with you. First, the "iteration" is optimized
by the compiler. Second, which is also related to my previous
comment on MACROs, I don't see any reason why fields and
columns can't be refered to by place holders as do boost.bind,
boost.lambda, boost.tuples and phoenix. Names? Sure you can
use names. Here's an example using Phoenix:

    tuple_index<0> my_field;
    val = tup[my_field];

see http://spirit.sourceforge.net/index.php?doc=docs/phoenix_v1_0/tuples.html

Regards,
--Joel


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