Search code examples
c++boostboost-beastbeast

Boost beast compilation error


d:\boost\boost\beast\core\detail\ostream.hpp(263): error C2955: 'boost::beast::detail::ostream_helper': use of class template requires template argument list

When compiling example project: http_server_small.cpp (from "beast")

boost\beast\core\detail\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 version 1.67.00, compiled under visual studio v171 (2017), x64

It looks like an error in boost/beast lib, but it's strange to see a compilation error in release version of the lib. (I'm not an author of the lib, I'm just trying to use it).

Maybe I'm missing some compilation options or flags? Have any one figured out what's the problem and how to solve it?


Solution

  • I think it needs to be:

    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_))
    {
    }
    

    Cannot see how any compiler would allow it to be otherwise.