Boost logo

Boost Users :

Subject: Re: [Boost-users] fusion struct adapted, latest trunk changes
From: Joel de Guzman (joel_at_[hidden])
Date: 2010-02-24 21:10:19


On 2/25/2010 2:18 AM, Christopher Schmidt wrote:
> Hicham Mouline schrieb:
>>
>> -----Original Message-----
>> From: "Hicham Mouline" [hicham_at_[hidden]]
>> Date: 24/02/2010 10:17 AM
>> To: boost-users_at_[hidden]
>> Subject: Re: fusion struct adapted, latest trunk changes
>>
>> Christopher,
>> <snip>
>> 1. temporarily, which files should I add this tweak to (boost\fusion\adapted\struct\extension.hpp is gone)
>> 2. I understand your changes are about adapting class/struct templates. Where should I add this tweak to if I wish to use it for adapted templates,
>>
>> --------------------------------------------------------------------------------
>>
>> Attached are the 2 files I have changed to trunk now. It works for my non template struct case, I haven't tested yet for struct templates /classes/ class templates
>>
>> Regards,
>>
>> ps: I hope to be able to add this later for the other headers.
>>
>> attached: boost\fusion\adapted\struct\detail\adapt_base.hpp
>> attached: boost\fusion\adapted\struct\detail\extension.hpp
>
> There is a minor bug in the new trunk code. I will fix it as soon as
> possible, and add your struct_member_name at the same time.
>

Hi Christopher,

BTW, while your in to this, you might as well add yet an other family:
the intrusive kind. In some (many?) cases, you'd want to define the
struct in one swoop instead of having one adapted. In this case,
you provide the struct yourself plus the scaffolding to adapt it.
As a bonus, with "intrusive" fusion structs, you can add constructors
and assignment to and from other fusion sequences (which is naturally
not possible with un-intrusive adapted structs). Perhaps

      BOOST_FUSION_DEFINE_STRUCT

would be a good name for this.

And hey! Your work on this is awesome! Well, exceeded my expectations,
as always.

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