Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost] [Fusion] Help with tuple adapter
From: Christopher Schmidt (mr.chr.schmidt_at_[hidden])
Date: 2010-01-21 18:06:44


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.

-Christopher


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