使用boost.spirit时弃用警告

Exa*_*gon 5 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
Run Code Online (Sandbox Code Playgroud)

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

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

Vot*_*fee 4

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

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

#define BOOST_ALLOW_DEPRECATED_HEADERS
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
Run Code Online (Sandbox Code Playgroud)

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