我有以下语法:
#include <boost/spirit.hpp>
struct point_grammar
: public boost::spirit::grammar<point_grammar>
{
template <typename Scanner>
struct definition
{
boost::spirit::rule<Scanner> E, S, V;
definition(const point_grammar &self)
{
using namespace boost::spirit;
E = S >> V;
S = '@' >> +(~ch_p('@') - V);
V = str_p(".PV@") | str_p(".CV@");
}
const boost::spirit::rule<Scanner> &start()
{
return E;
}
};
};
Run Code Online (Sandbox Code Playgroud)
编译时,编译器显示以下警告:
/usr/include/boost/spirit.hpp:18:4:警告:"此标头已弃用.请使用:boost/spirit/include/classic.hpp"
但是当改变#include for boost/spirit/include/classic.hpp时,我有以下错误:
(在'<'标记之前的预期模板名称)在以下行中::: public boost :: spirit :: grammar.
我能做什么?
boost-spirit ×1