1

我无法打印 http 请求的基础,因为迁移到野兽 1.70.0

我之前是通过以下方式完成的:

std::cerr << ctx.res.base()

但目前看起来运算符没有重载,如何在 1.70.0 中实现?

可以使用以下代码重现问题:(请注意应该使用野兽 1.70.0)

#include <boost/beast/http.hpp>
#include <boost/beast/http/write.hpp>
#include <iostream>

using namespace boost::beast;

http::response<http::string_body> res {};

int main()
{
    std::cout << res.base();
}
4

1 回答 1

3

这是 Boost 1.70 中的一个错误,已在 1.71 版中修复。一种解决方法是BOOST_BEAST_ALLOW_DEPRECATED为您的构建定义宏。

于 2019-08-20T13:06:34.160 回答