jjzjj

c++ - boost::spirit 1.53 multi_pass iterator相关的编译错误

coder 2024-02-24 原文

代码:

typedef std::string::const_iterator iterator;
namespace parsers
{
    namespace spirit = ::boost::spirit;
    namespace ascii = ::boost::spirit::ascii;
    namespace phoenix = ::boost::phoenix;
    spirit::qi::rule< iterator, void(std::string), ascii::space_type > action_parser = 
        '"'
        > spirit::qi::lit("action")
        > spirit::qi::labels::_r1
        > '"';
}

错误:

> 1>CL : warning : This header is deprecated. Please use:
> boost/spirit/include/classic.hpp
> 1>D:\CPP\boost\boost_1_53_0\boost_1_53_0\boost/spirit/home/support/iterators/multi_pass_fwd.hpp(59):
> error C2976: 'boost::spirit::multi_pass' : too few template arguments
> 1>D:\CPP\boost\boost_1_53_0\boost_1_53_0\boost/spirit/home/support/iterators/multi_pass_fwd.hpp(86):
> error C3203: 'multi_pass' : unspecialized class template can't be used
> as a template argument for template parameter 'Iterator', expected a
> real type
> 1>D:\CPP\boost\boost_1_53_0\boost_1_53_0\boost/spirit/home/support/iterators/multi_pass_fwd.hpp(86):
> error C2955: 'boost::spirit::multi_pass' : use of class template
> requires template argument list
> 1>D:\CPP\boost\boost_1_53_0\boost_1_53_0\boost/spirit/home/support/iterators/multi_pass_fwd.hpp(86):
> error C2977: 'boost::spirit::traits::is_multi_pass' : too many
> template arguments
> 1>D:\CPP\boost\boost_1_53_0\boost_1_53_0\boost/spirit/home/support/iterators/multi_pass.hpp(183):
> error C2976: 'boost::spirit::multi_pass' : too few template arguments
> 1>D:\CPP\boost\boost_1_53_0\boost_1_53_0\boost/spirit/home/support/iterators/istream_iterator.hpp(37):
> error C2955: 'boost::spirit::multi_pass' : use of class template
> requires template argument list

最佳答案

Q.: I removed the boost/spirit.hpp inclusion. Why was it the reason? P.S. Thx to FoReVer

答:是因为

CL : warning : This header is deprecated. Please use:
> boost/spirit/include/classic.hpp

换句话说:它告诉你确切的原因。这转化为“仅仅因为”的正常生活。

现在谈谈为什么开发人员会弃用旧 header :

Wikipedia Deprecation

Deprecation is a status applied to a computer software feature, characteristic, or practice indicating it should be avoided, typically because of being superseded

你知道了:“通常是因为被取代了”。在这种情况下,SpiritV2 在 2009 年左右取代了 SpiritV1(?)。文档是这样说的:

Spirit Classic

The Spirit V1.8.x code base has been integrated with Spirit V2. It is now called Spirit.Classic. Since the directory structure has changed (the Spirit Classic headers are now moved to the $BOOST_ROOT/boost/spirit/home/classic directory), we created forwarding headers allowing existing applications to compile without any change.

However, these forwarding headers are deprecated, which will result in corresponding warnings generated for each of the headers starting with Boost V1.38. The forwarding headers are expected to be removed in the future.

The recommended way of using Spirit Classic now is to include header files from the directory $BOOST_ROOT/boost/spirit/include. All Spirit Classic headers in this directory have 'classic_' prefixed to their name.

总而言之,它只是意味着:Spirit Classic 已经过时了。不要使用它。

如果您继承了 Spirit V1 解析器并需要有关迁移到 Spirit V2 的指导:

注意:我们说话时,SpiritX3 已经在开发中。参见 here

关于c++ - boost::spirit 1.53 multi_pass iterator相关的编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17165358/

有关c++ - boost::spirit 1.53 multi_pass iterator相关的编译错误的更多相关文章

  1. ruby-on-rails - 如何优雅地重启 thin + nginx? - 2

    我的瘦服务器配置了nginx,我的ROR应用程序正在它们上运行。在我发布代码更新时运行thinrestart会给我的应用程序带来一些停机时间。我试图弄清楚如何优雅地重启正在运行的Thin实例,但找不到好的解决方案。有没有人能做到这一点? 最佳答案 #Restartjustthethinserverdescribedbythatconfigsudothin-C/etc/thin/mysite.ymlrestartNginx将继续运行并代理请求。如果您将Nginx设置为使用多个上游服务器,例如server{listen80;server

  2. ruby-on-rails - 相关表上的范围为 "WHERE ... LIKE" - 2

    我正在尝试从Postgresql表(table1)中获取数据,该表由另一个相关表(property)的字段(table2)过滤。在纯SQL中,我会这样编写查询:SELECT*FROMtable1JOINtable2USING(table2_id)WHEREtable2.propertyLIKE'query%'这工作正常:scope:my_scope,->(query){includes(:table2).where("table2.property":query)}但我真正需要的是使用LIKE运算符进行过滤,而不是严格相等。然而,这是行不通的:scope:my_scope,->(que

  3. ruby - Sinatra set cache_control to static files in public folder编译错误 - 2

    我不知道为什么,但是当我设置这个设置时它无法编译设置:static_cache_control,[:public,:max_age=>300]这是我得到的syntaxerror,unexpectedtASSOC,expecting']'(SyntaxError)set:static_cache_control,[:public,:max_age=>300]^我只想将“过期”header设置为css、javaascript和图像文件。谢谢。 最佳答案 我猜您使用的是Ruby1.8.7。Sinatra文档中显示的语法似乎是在Ruby1.

  4. ruby - 使用 `+=` 和 `send` 方法 - 2

    如何将send与+=一起使用?a=20;a.send"+=",10undefinedmethod`+='for20:Fixnuma=20;a+=10=>30 最佳答案 恐怕你不能。+=不是方法,而是语法糖。参见http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html它说Incommonwithmanyotherlanguages,Rubyhasasyntacticshortcut:a=a+2maybewrittenasa+=2.你能做的最好的事情是:

  5. 安卓apk修改(Android反编译apk) - 2

    最近因为项目需要,需要将Android手机系统自带的某个系统软件反编译并更改里面某个资源,并重新打包,签名生成新的自定义的apk,下面我来介绍一下我的实现过程。APK修改,分为以下几步:反编译解包,修改,重打包,修改签名等步骤。安卓apk修改准备工作1.系统配置好JavaJDK环境变量2.需要root权限的手机(针对系统自带apk,其他软件免root)3.Auto-Sign签名工具4.apktool工具安卓apk修改开始反编译本文拿Android系统里面的Settings.apk做demo,具体如何将apk获取出来在此就不过多介绍了,直接进入主题:按键win+R输入cmd,打开命令窗口,并将路

  6. ruby - 如何计算 Liquid 中的变量 +1 - 2

    我对如何计算通过{%assignvar=0%}赋值的变量加一完全感到困惑。这应该是最简单的任务。到目前为止,这是我尝试过的:{%assignamount=0%}{%forvariantinproduct.variants%}{%assignamount=amount+1%}{%endfor%}Amount:{{amount}}结果总是0。也许我忽略了一些明显的东西。也许有更好的方法。我想要存档的只是获取运行的迭代次数。 最佳答案 因为{{incrementamount}}将输出您的变量值并且不会影响{%assign%}定义的变量,我

  7. ruby-on-rails - 在具有 ActiveRecord 条件的相关模型中按字段排序 - 2

    我正在尝试按Rails相关模型中的字段进行排序。我研究的所有解决方案都没有解决如果相关模型被另一个参数过滤?元素模型classItem相关模型:classPriority我正在使用where子句检索项目:@items=Item.where('company_id=?andapproved=?',@company.id,true).all我需要按相关表格中的“位置”列进行排序。问题在于,在优先级模型中,一个项目可能会被多家公司列出。因此,这些职位取决于他们拥有的company_id。当我显示项目时,它是针对一个公司的,按公司内的职位排序。完成此任务的正确方法是什么?感谢您的帮助。PS-我

  8. arrays - Ruby 数组 += vs 推送 - 2

    我有一个数组数组,想将元素附加到子数组。+=做我想做的,但我想了解为什么push不做。我期望的行为(并与+=一起工作):b=Array.new(3,[])b[0]+=["apple"]b[1]+=["orange"]b[2]+=["frog"]b=>[["苹果"],["橙子"],["Frog"]]通过推送,我将推送的元素附加到每个子数组(为什么?):a=Array.new(3,[])a[0].push("apple")a[1].push("orange")a[2].push("frog")a=>[[“苹果”、“橙子”、“Frog”]、[“苹果”、“橙子”、“Frog”]、[“苹果”、“

  9. += 的 Ruby 方法 - 2

    有没有办法让Ruby能够做这样的事情?classPlane@moved=0@x=0defx+=(v)#thisiserror@x+=v@moved+=1enddefto_s"moved#{@moved}times,currentxis#{@x}"endendplane=Plane.newplane.x+=5plane.x+=10putsplane.to_s#moved2times,currentxis15 最佳答案 您不能在Ruby中覆盖复合赋值运算符。任务在内部处理。您应该覆盖+,而不是+=。plane.a+=b与plane.a=

  10. .net - 是否有 Ruby .NET 编译器? - 2

    是否有适用于Ruby语言的.NETFramework编译器?我听说过DLR(动态语言运行时),这是否将使Ruby能够用于.NET开发? 最佳答案 IronRuby是Microsoft支持的项目,建立在动态语言运行时之上。 关于.net-是否有Ruby.NET编译器?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/199638/

随机推荐