
Patel, Anand wrote:
I have used Sink class example and now I am trying to use that as my sink device for the stream object.
char* file_name = "c:/devel/output/file_one.txt";
typedef container_sink std::iostream some_sink;
stream
my_file_stream; last line I get many errors as following:
1>c:\documents and settings\user\my documents\visual studio 2008\projects\filereaderwriter\sink.h(11) : error C2039: 'value_type' : is not a member of 'std::basic_iostream<_Elem,_Traits>' 1> with 1> [ 1> _Elem=char, 1> _Traits=std::char_traits<char> 1> ] 1> c:\program files\boost\boost_1_39\boost\iostreams\traits.hpp(176) : see reference to class template instantiation 'foobar::container_sink<Container>' being compiled 1> with 1> [ 1> Container=std::iostream 1> ] [snip]
Assuming that you refer to the container_sink defined in libs/iostreams/example/container_device.hpp, container_sinkstd::iostream is an invalid instantiation since, as the container_sink comment states: "Model of Sink which appends to an STL-compatible sequence." and std::iostream is not an STL-compatible sequence.