使用boost.spirit时弃用警告

时间:2016-05-22 09:59:28

标签: c++ boost boost-spirit boost-spirit-qi

我正在尝试使用boost.spirit.qi编写一些解析器,但是当我编译时,我收到了以下不推荐的警告:

In file included from /usr/include/boost/iostreams/detail/is_dereferenceable.hpp:12:0 ... 

#pragma message: NOTE: Use of this header (bool_trait_def.hpp) is deprecated

#pragma message: NOTE: Use of this header (template_arity_spec.hpp) is deprecated

我使用的是错误的解析器还是旧的?我怎样才能摆脱这些警告?

编辑:/usr/include/boost/iostreams/detail/is_dereferenceable.hpp以某种方式包含/usr/include/boost/spirit/include/qi.hpp 我正在使用Boost版本1.61

1 个答案:

答案 0 :(得分:2)

我在使用 boost geometry 包时遇到了类似的问题,无法升级 boost 来修复错误。

使用以下定义禁用 boost 弃用警告:

const flattenedOrderProducts = orderProductsArr.reduce((acc, item) => {
  for (let itemsLeft = 1; itemsLeft <= item.quantity; itemsLeft ++) {
    acc.push({ ...item, itemsLeft });
  }
  return acc;
}, [])

请注意,第二个定义处理与已弃用警告一起出现且可能不需要的常见警告。

相关问题