Subject: Re: [boost] Standard stream from C fopen()
From: Eric MALENFANT (Eric.Malenfant_at_[hidden])
Date: 2010-11-12 17:34:14
De : Claude
> So these lines are right?
> stream_buffer<file_descriptor_source> fpstream (fileno(fd));
> std::istream in (&fpstream);
> I making a stream_buffer from with a file_descriptor_source as template
Almost. You should create the file_descriptor_source to pass it to the stream_buffer's constructor:
std::istream in (&fpstream);
You could also avoid the intermediate stream_buffer by simply writing:
instead, because a boost::iostreams::stream<something_that_is_a_source> inherits from std::istream
(BTW, don't forget to fclose()!)
> Excuse me , but I don't know well the C++...
No problem, it happened even to the best here :)
> How can I move this question in "user" mailing list?