Boost logo

Boost Users :

Subject: Re: [Boost-users] iostreams: streambuf class fails to compile on type check
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2016-03-12 22:27:39


On 03/12/2016 07:48 PM, Dan Bloomquist wrote:
> I'm trying to insert my own stream buffer into a boost stream. Here is
> the code
> <>
> At the top are two arbitrary streambuf derived classes I copied from the
> web that are said to work with the std::stream. They don't work either.
> My work is in the rtf namespace. In main there is a test with my device,
> file_source, and std::ifstream derived, they all work. Then I've tried
> the likes of:
> rtf::basic_stream< char, char_array_buffer > io_4( input );
> rtf::basic_stream< char, outbuf > io_4( input );
> and the one I want to work:
> rtf::basic_stream< char, rtf::rtf_stream_buffer > io_4( input );
> they all fail at: { BOOST_STATIC_ASSERT(is_std_io<T>::value); }
> line 66 in concept_adapter.hpp. All the classes are derived from
> std::basic_streambuf which is on the list #ifndef
> And I could not find it defined with agent ransack So, I seem to be
> missing something fundamental and just don't know what it could be.

  It fails because char_array_buffer doesn't meet
the requirements of boost::iostreams::stream.

T - A CopyConstructible model of one of the Device concepts

In particular, it is not CopyConstructible.

In Christ,
Steven Watanabe

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at