Boost logo

Boost Users :

Subject: Re: [Boost-users] Generating a large number of class member variables: PP vs mpl
From: Hicham Mouline (hicham_at_[hidden])
Date: 2009-01-20 05:23:33


But once I have my mpl::vector or fusion::vector,
how do i apply a meta function like for_each
to generate the class members automatically.

for e.g., I define the vector<> with 15 elements,
I should be able to have 15 member types in the class,
without manually writing at_c<0> .... at_c<1>?

I'm now looking again at mpl::inherit_linearly

rds,

> ----- Original Message -----
> From: "Juraj Ivančić" <juraj.ivancic_at_[hidden]>
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] Generating a large number of class member variables: PP vs mpl
> Date: Tue, 20 Jan 2009 11:03:56 +0100
>
>
> Hicham Mouline wrote:
>
> > Is it possible to generate the members from the mpl::vector<> ?
>
> It is certainly possible and is already done in Boost.Fusion.
>
> See
> http://www.boost.org/doc/libs/1_37_0/libs/fusion/doc/html/index.html
> and especially
> http://www.boost.org/doc/libs/1_37_0/libs/fusion/doc/html/fusion/container.html
>
> HTH,
> Juraj


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