Hi Pete, On Mon, Sep 27, 2010 at 5:28 AM, PB <newbarker@gmail.com> wrote: <snip code>
BOOST_FUSION_ADAPT_STRUCT( Transition, (boost::optional<boost::variant<Word,Text>>, token) ) <snip code> Compiler output: error warning C4002: too many actual parameters for macro 'BOOST_FUSION_ADAPT_STRUCT_FILLER_0'. <etc>
Why is this, and what are the constraints on the types fed to BOOST_FUSION_ADAPT_STRUCT?
The problem seems to be that the preprocessor is seeing the ',' in boost::variant and is parsing it like a tuple of 3 objects: "boost::optional<boost::variant<Word," "Text>>" and "token", while Boost.Fusion expects 2 objects. The normal solution is to add a set of parentheses around the token with a comma, but that doesn't seem to work here. I think your typedef solution is probably the simplest and best for this case -- but my skills with the preprocessor are definitely incomplete. HTH, Nate