构建 CGAL 代码时请注意:不推荐在全局命名空间中声明 Bind 占位符(_1、_2、...)的做法

Was*_*abi 5 c++ boost cmake cgal

当我使用 构建 CGAL 示例时cmake,我收到以下注释:

#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.
Run Code Online (Sandbox Code Playgroud)

#define BOOST_BIND_NO_PLACEHOLDERS我尝试在代码的最开头和主体中添加using namespace BOOST_BIND_GLOBAL_PLACEHOLDERS,但它不起作用。代码可以构建,只是一个很烦人的注释。

增强版本 = 1.73 GCC 版本 = 7.5.0

mic*_*fan 1

为了方便旧项目,添加以下行CMakeLists.txt以在整个项目中定义 BOOST_BIND_GLOBAL_PLACEHOLDERS 。

add_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)
Run Code Online (Sandbox Code Playgroud)