Boost logo

Boost Users :

Subject: Re: [Boost-users] fusion struct adapt macro, construct the struct from a fusion vector
From: Joel de Guzman (joel_at_[hidden])
Date: 2010-01-19 21:48:25


On 1/20/2010 2:05 AM, Hicham Mouline wrote:

> Following my previous attempt, replacing the functor applied by foreach
> to the zipped sequence by:
>
> struct assignelt {
>
> template <typename T>
> void operator()( const vector2<const T&, const T&>& seqpairs ) const
> {
> typedef vector2<const T&, const T&> pair_t;
> const_cast<T&>(at_c<0, const pair_t>(seqpairs)) = at_c<1, const
> pair_t>(seqpairs);
> }
> };
> works.
>
> I can now construct my struct params from an equivalent fusion sequence.
> This constructor is identical for all my params struct.
> I have structs params1 to params100
>
> Is there a way to factorise this ctor and not repeat its definition in
> the 100 struct params?
> Is this possible with a base struct templated on the derived struct?

Wow. 100! Anyway, I've seem to lost context already. Pardon me, I'm
not following this thread well. Could you rephrase the problem again
in simpler terms?

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net
http://www.facebook.com/djowel
Meet me at BoostCon
http://www.boostcon.com/home
http://www.facebook.com/boostcon

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