c++ - 使用 boost.spirit 时不推荐使用的警告

标签 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

最佳答案

我在使用 boost geometry 包时遇到了类似的问题,无法升级 boost 来修复错误。
使用以下定义禁用 boost 已弃用警告:

#define BOOST_ALLOW_DEPRECATED_HEADERS
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
请注意,第二个定义处理与不推荐使用的警告一起出现并且可能不需要的常见警告。

关于c++ - 使用 boost.spirit 时不推荐使用的警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37372867/

相关文章:

c++ - count_until 和 accumulate_until 的实现?

c++ - 检查路径是否存在于 boost 属性树中

c++ - 模棱两可的变种和提升精神x3

c++ - 调试断言失败…_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)

.net - 开发交易应用程序

C++进程类错误

c++ - boost::spirit 指针属性是否用 nullptr 初始化?

c++ - std::unique 与谓词比较 std::string 不删除重复项

c++ - boost 变体 : how to get currently held type?

c++ - 用灵气解析成 std​​::vector<string>,出现段错误或断言失败