Boost 1.64 和 Visual Studio 2017 的问题

Ole*_*ikh 3 c++ boost visual-c++

我正在将库升级到 MSVC 141 并迁移到 Visual Studio 2017。

我已经下载了最新的 Boost 库 (boost_1_64_0_b2-msvc-14.1-64.exe)。构建代码时,我收到此错误:

...\boost\move\detail\type_traits.hpp(757): 错误 C2187: 语法错误: ')' 在这里出乎意料 ...\boost\move\detail\type_traits.hpp(763): 注意:见参考到正在编译的类模板实例化 'boost::move_detail::is_copy_constructible'

在提到的标头中,BOOST_MOVE_TT_CXX11_IS_COPY_CONSTRUCTIBLE定义了但最新的 MSVC 不理解所附的代码。

取消定义这个宏有帮助,但有更好的解决方案来解决这个问题吗?这是什么原因?

Ser*_*tch 5

正如此处所建议的,U在每次包含 cpprest 标头之后或在包含 boost 标头之前取消定义宏。

例子:

#include <cpprest/http_client.h>
#undef U
Run Code Online (Sandbox Code Playgroud)