2

Here is a coliru of the error: http://coliru.stacked-crooked.com/a/a03c61dc0c33c94b

I have a type with two template parameters like so:

template <typename T, typename U> class DoubleTemplate {};

In a struct I have a member of the above type like so:

namespace test
{
    struct adaptee
    {
        DoubleTemplate<int, int> dt;
    };
}

When I attempt to call the Boost adapt function like so:

BOOST_FUSION_ADAPT_STRUCT( test::adaptee,
    (DoubleTemplate<int, int>, dt) )

it complains that there are 3 parameters being passed in (I am guessing it is seeing these three: DoubleTemplate<int, int>, dt)

It works ok if I typedef the DoubleTemplate type and use the shorter name in the Boost adapt call, but that would require a nasty 10-or-so typedefs in my code.

Is there a simple way to just pass in the double template? I feel like I am missing a simple answer here. Thanks for your help.

Cory-G
  • 1,025
  • 14
  • 26
  • 2
    This doesn't answer your question but if you are using boost 1.58 or higher you can simply use [`BOOST_FUSION_ADAPT_STRUCT( test::adaptee, dt )`](http://coliru.stacked-crooked.com/a/4be39a0cd86a182a). – llonesmiz Aug 19 '15 at 20:51
  • 3
    I cannot comment, so I'm posting it as an answer. See answers [here](http://stackoverflow.com/questions/13842468/comma-in-c-c-macro). **upd**: It turns out that short answers become comments even if you don't have enough reputation. – nightuser Aug 19 '15 at 21:57

0 Answers0