提升野兽编译错误

时间:2018-05-16 06:04:07

标签: c++ boost boost-beast beast

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

编译示例项目时: http_server_small.cpp(来自"野兽")

升压\兽\芯\详细\ 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的作者,我只是想尝试使用它。)

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

2 个答案:

答案 0 :(得分: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_))
{
}

看不出任何编译器会如何允许它。

答案 1 :(得分:1)

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