1

d:\boost\boost\beast\core\detail\ostream.hpp(263): error C2955: 'boost::beast::detail::ostream_helper': 使用类模板需要模板参数列表

编译示例项目时:http_server_small.cpp(来自“beast”)

提升\野兽\核心\细节\ostream.hpp:

template<class DynamicBuffer, class CharT, class Traits>
ostream_helper<DynamicBuffer, CharT, Traits, true>::
ostream_helper(
        ostream_helper&& other)
    : std::basic_ostream<CharT, Traits>(&osb_)
    , osb_(std::move(other.osb_))
{
}

Boost 版本 1.67.00,在 Visual Studio v171 (2017)、x64 下编译

它看起来像是 boost/beast lib 中的错误,但在 lib 的发布版本中看到编译错误很奇怪。(我不是lib的作者,我只是想使用它)。

也许我缺少一些编译选项或标志?有没有人弄清楚问题是什么以及如何解决?

4

2 回答 2

1

这看起来像是您的配置问题,因为 1. 是的,它是有效的 C++,2. 我在所有配置中使用最新的 Visual Studio 2017 编译它都没有问题,以及 3. AppVeyor 脚本定期编译库和示例,并且编译它没有问题:https ://ci.appveyor.com/project/vinniefalco/beast/history

于 2018-05-16T15:59:06.720 回答
1

我认为它需要是:

template<class DynamicBuffer, class CharT, class Traits>
ostream_helper<DynamicBuffer, CharT, Traits, true>::
ostream_helper(
    ostream_helper<DynamicBuffer, CharT, Traits, true>&& other)
: std::basic_ostream<CharT, Traits>(&osb_)
, osb_(std::move(other.osb_))
{
}

看不到任何编译器将如何允许它以其他方式出现。

于 2018-05-16T06:41:30.117 回答