Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost] [Fusion] Help with tuple adapter
From: Joel de Guzman (joel_at_[hidden])
Date: 2010-01-20 19:59:59


On 1/21/2010 3:52 AM, Bill Nell wrote:
> Hi all, I'm having some trouble getting the boost fusion tuple adapter working (the one
> that makes boost::tuples into conforming sequence types). I'm assuming that the
> adapted tuple should now be a legal MPL sequence but mpl::is_sequence yields false and
> consequently mpl::for_each doesn't work on the tuple type either. The following
> program is an illustration of what I am trying to do. I guess I must be missing
> something simple?
>
> Any help would be appreciated.

This has come up every now and then. First of all, Fusion's definition of a
"conforming MPL sequence" is one that conforms to the MPL ForwardSequence,
which is the least specialized of all MPL sequences: http://tinyurl.com/ygpqr9m
Notice that there is no requirement for mpl::is_sequence. My contention is that
the code that relies on mpl::is_sequence is the problem, not Fusion. Either that,
or update the MPL docs to add that requirement. So far, I haven't got any clear
response from the MPL authors yet.

Having said that, it is easy to add the specialization for all external adapted
sequences. Would you like to contribute such code?

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