Boost logo

Boost Users :

Subject: Re: [Boost-users] class composition
From: Hicham Mouline (hicham_at_[hidden])
Date: 2009-01-13 15:12:13


-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Steven Watanabe
Sent: 13 January 2009 18:20
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] class composition

>AMDG

>You can--or you can just use fusion.

>boost::fusion::as_vector<member_types>::type v;

>boost::fusion::at_c<0>(v); // object of type type1
>boost::fusion::at_c<1>(v); // object of type type2

You mean I would have to literally actually write, if for e.g. I have 20
types,

class C {
....
boost::fusion::at_c<0>(v);
boost::fusion::at_c<1>(v);
...
boost::fusion::at_c<19>(v);
}

I like the PP version better as I don't need to change anything if later I
add 1 more type to the vector.
Am I understanding you right?

>In Christ,
>Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net