
On 1/22/2010 7:06 AM, Christopher Schmidt wrote:
Bill Nell schrieb:
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?
mpl::for_each should work fine with any built-in or adapted fusion sequence. You are experiencing this problem due to fusion not specializing mpl::sequence_tag for adapted types. I committed a patch a few weeks ago that fixed this problem. Grab a copy of the trunk or the release branch and try it again. As Joel pointed out, mpl::is_sequence is not required to evaluate to mpl::true_ for fusion sequences. Although my patch has the side effect that mpl::is_sequence is true for fusion sequences now, you should not rely on this behavior. It may not be reproducible with certain toolchains and mpl's implementation might change in the future.
Ah yeah, I forgot about that! Thanks as always, Christopher! 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