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 22:55:55


On 1/20/2010 11:43 AM, Hicham Mouline wrote:
> Yes, something in that order. We are testing systems and we don't know
> which will give the best results.
>
> With your and Hartmut's help, I wrote a constructor for my struct
> pararms that takes a fusion sequence as an argument:
>
> template<typename Seq>
> params( const Seq& seq, ... )
> {
> for_each( zip(*this, seq), assignelt() );
> }
>
> params is adapted to be a fusion sequence.
> assignelt() is the functor that assigns from seq to params with the help
> of the zipped sequence
>
> Now, my question was whether the ctor could be refactored because it is
> identical for all the 100 params structs.

So you have 100 similar structs that all want to to have this
constructor? But why? Why not simply work on fusion::vectors
instead of adapting structs?

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