Boost logo

Boost Users :

Subject: Re: [Boost-users] fusion struct adapt macro, construct the struct from a fusion vector
From: Hicham Mouline (hicham_at_[hidden])
Date: 2010-01-21 01:20:52


----- Original Message -----
From: "Joel de Guzman" <joel_at_[hidden]>
To: <boost-users_at_[hidden]>
Sent: Wednesday, January 20, 2010 6:09 PM
Subject: Re: [Boost-users] fusion struct adapt macro, construct the struct
from a fusion vector
>>
> Ok, understood. Well, then I suggest that you don't mess with the structs
> and leave them alone. The goal of FUSION_ADAPT is non-intrusive
> adaptation.
> Instead, if you control the assignment to your structs from fusion vectors
> anyway (which I imagine is the case because as you said, your users do
> not have to deal with fusion vectors), then I suggest a generic free
> function
> assign instead of decorating all your structs:
>
> template<typename Struct, typename Seq>
> void assign( Struct& v, const Seq& seq )
> {
> ...
> }
The free function is what I went with and it works perfectly fine with my
different params structs.
Thanks,


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