【问题标题】:Fail to compile program using boost::spirit with Intel C++ compiler使用带有英特尔 C++ 编译器的 boost::spirit 编译程序失败
【发布时间】:2016-03-18 19:24:27
【问题描述】:

我正在尝试使用英特尔 C++ 编译器编译以下示例 http://www.boost.org/doc/libs/1_60_0/libs/spirit/example/qi/compiler_tutorial/calc3.cpp

编译失败,我得到 300 kB 的错误。前几个是:

boost/fusion/container/vector/vector.hpp(69): error: namespace "boost::fusion::vector_detail::result_of" has no member "value_at_c"
          : boost::is_convertible<Sequence, typename result_of::value_at_c<This, 0>::type>
                                                                ^
boost/fusion/container/vector/vector.hpp(69): error: expected a ">"
          : boost::is_convertible<Sequence, typename result_of::value_at_c<This, 0>::type>
                                                                          ^
boost/fusion/container/vector/vector.hpp(69): error: not a class or struct name
          : boost::is_convertible<Sequence, typename result_of::value_at_c<This, 0>::type>
            ^

命令行是

icl.exe /I<path-to-boost> calc3.cpp

Boost 版本:1.60,编译器版本:15.0.6.285 Build 20151119

虽然我能够通过更改第 69 行来修复错误

struct is_convertible_to_first
        : boost::is_convertible<Sequence, typename result_of::value_at_c<This, 0>::type>
    {};

struct is_convertible_to_first
        : boost::is_convertible<Sequence, typename boost::fusion::result_of::value_at_c<This, 0>::type>
    {};

, 我还是很好奇为什么会出现问题?

【问题讨论】:

    标签: c++ boost icc


    【解决方案1】:

    最合理的猜测是 ICC 发现的 result_of 命名空间 within boost::fusion::vector_detail 只是不符合标准的编译器的一种解决方法(例如,我认为 GCC 4.6 也缺乏一些支持)所以,名称与boost::fusion::result_of 冲突仅在此处出现。

    所以这是库开发人员可以报告的错误;命名空间应该更符合旧编译器的要求。 (如果不支持上述编译器,可能不会再修复)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-11-11
      • 1970-01-01
      • 2012-08-08
      • 1970-01-01
      • 2017-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多