Boost logo

Boost Users :

Subject: Re: [Boost-users] How to get tuple member type ?
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2010-07-04 22:13:00

On Fri, Jul 2, 2010 at 7:11 AM, Robert Jones <robertgbjones_at_[hidden]> wrote:
> On Fri, Jul 2, 2010 at 1:26 PM, Timothy Madden <terminatorul_at_[hidden]>
> wrote:
>>  Anyway I find that when using tuples heavily it is actually better to
>> define classes/structs for your data, as using t.get<idxHostname>() all the
>> time is no better than t.hostname, and also not clearer.
> This has been my experience too - that the get<N>() notation tends to
> obscure, and
> effectively introduce another unnecessary level of indirection. As I
> understand
> it, what tuples offer is that they're a building block for type sequences,
> which enable
> them to be handled generically, ie become the foundation for Boost.Fusion.

Do note, Boost.Fusion can turn structs/classes into tuples
(Boost.Fusion.Vectors) so you can use them purely interchangably.
Boost.Fusion is also very easy to use, especially if you know
Boost.MPL (it is basically a runtime mixed version of Boost.MPL, very
powerful, quite easy).

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at