[io::streams] Using array device and std::output_iterator
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 istream_iterator. 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 chunk_reading_iterator_suite::ctor::test_method()': src/chunk_reading_iterator_test.cpp:86: error: no matching function for call to 'std::istream_iterator<unsigned char, char, std::char_traits<char>, int>::istream_iterator(chunk_reading_iterator_suite::<unnamed>::array_stream&)' Thanks for any suggestions, Ovanes
participants (1)
-
Ovanes Markarian