I\'m asking this question because I\'m a bit helpless: this error occurs ONLY with Visual Studio, GCC compiles it without errors or even warnings. Since this is some portable co
std::ostream
is a type alias for std::basic_ostream<char>
. The constructor of std::basic_ostream<char>
expects a pointer to a stream buffer to which the output stream is associated. You must provide one.
The signature of the constructor is the following one:
explicit basic_ostream( std::basic_streambuf<CharT, Traits>* sb );
Your class constructor should look something like this:
class MyObject : public Socket, public std::ostream
{
MyObject(/* ... */)
:
std::ostream(/* provide a ptr to a stream buffer here /*)
// ...
{
// ...
}
};
Also see this for a reference.