Attributes from Boost.Spirit grammar: error from std:vector of boost::variant
问题 I got a working parser for reading position descriptions for a board game (international draughts, official grammar): #include <boost/spirit/home/x3.hpp> #include <iostream> namespace x3 = boost::spirit::x3; auto const colon = x3::lit(':'); auto const comma = x3::lit(','); auto const dash = x3::lit('-'); auto const dot = x3::lit('.'); auto const king = x3::char_('K'); auto const color = x3::char_("BW"); auto const num_sq = x3::int_; auto const num_pc = -king >> num_sq; // Kxx means king on