I'm updating some old code which worked under older (~1.38 or so) versions of boost. I've updated to boost 1.63 and can not seem to figure out how to get the old version to compile.
This is the relevant parts
void print (StateStruct const& ss)
{
std::cout << ss.Name;
}
struct StateStruct
{
std::string Name;
float avalue;
}
BOOST_FUSION_ADAPT_STRUCT (
StateStruct,
(std::string, NAME)
(float, avalue)
)
and the parser rule that used to work
state %=
( qi::lexeme[qi::char_(a-zA-Z) >> +qi::char("-a-zA-Z0-9_")]
>> qi::float_
)
[phoenix::bind(&print, qi::_val)]
;
qi::rule (Iterator, StateStruct(), skipper_type) state;
With g++ 6.3.0 and boost 1.63 I get and error message along the lines of
invalid initialization of type const StateStruct::StateStruct&
from expression of type boost::fusion::vector<boost::fusion::vector<char, std::vector<char, std::allocator<char> > >, float>
without the semantic action the code compiles and debugging the state rule shows the expected results. What do I need to do to correctly initialize the struct?