Hello,
The following program (written in VS2008/VC9 with Boost 1.44) doesn't compile:
#include
#include
#include
#include <string>
#include <vector>
struct Word {std::string str;};
struct Text {std::string str;};
struct Transition
{
boost::optional> token;
};
BOOST_FUSION_ADAPT_STRUCT(Word,(std::string, str))
BOOST_FUSION_ADAPT_STRUCT(Text,(std::string, str))
BOOST_FUSION_ADAPT_STRUCT(
Transition,
(boost::optional>, token)
)
int main(int argc,char *argv[])
{
return 0;
}
Compiler output:
error warning C4002: too many actual parameters for macro
'BOOST_FUSION_ADAPT_STRUCT_FILLER_0'.
<etc>
If I introduce a typedef for the long type:
typedef boost::optional> TokenType;
and change the adapt struct to use the shorter name, it works:
BOOST_FUSION_ADAPT_STRUCT(
Transition,
(TokenType, token)
)
Why is this, and what are the constraints on the types fed to
BOOST_FUSION_ADAPT_STRUCT?
Thanks,
Pete