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?

2 answers

  • answered 2018-05-16 06:41 Sean F

    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.

  • answered 2018-05-16 15:59 Vinnie Falco

    This looks like a configuration problem on your end because 1. Yes, it is valid C++, 2. I have no trouble compiling it using Visual Studio 2017 latest, in all configurations, and 3. the AppVeyor scripts regularly compile the library and examples, and have no trouble compiling it: https://ci.appveyor.com/project/vinniefalco/beast/history