Boost logo

Boost Users :

Subject: [Boost-users] [io::streams] Using array device and std::output_iterator
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2011-07-13 09:47:36

Hello *,

I tried to use an array-device based stream and wantet to pass the stream to
std::output_iterator or std::istream_iterator, but unfortunately, I get a
compilation error with gcc 4.3.5.
Boost::IOStreams docu states that the io::stream is either derived from
std::basic_istream or std::basic_ostream or both dependent on the underlying
device category. array has seekable category, so I'd expect io::stream to
derive from both and be compatible with ostream_iterator or

Here is the code snippet:

  typedef unsigned char byte;
  typedef io::basic_array<byte> array_device;
  typedef io::stream<array_device> array_stream;

  array_stream ios_(ptr_to_byte_array);

  std::istream_iterator<byte> in(ios_);

And the last line results in the error stating:

src/chunk_reading_iterator_test.cpp: In member function 'void
src/chunk_reading_iterator_test.cpp:86: error: no matching function for call
to 'std::istream_iterator<unsigned char, char, std::char_traits<char>,

Thanks for any suggestions,

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