Boost logo

Boost :

Subject: Re: [boost] Standard stream from C fopen()
From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2010-11-14 09:28:38


Claude wrote:
> Ok, I now make correctly my stream with:
>
> stream<file_descriptor_source> in(file_descriptor_source(fp));
>
> But, if I use the << operator on "in" with:
>
>
> in<<"Hello";
>
> It don't work :-(
> I think I could use my object like any other stream ...

A source can't be written to. Did you mean:

   in >> some_var;

or if you want to write to the stream you would use:

   stream<file_descriptor_sink> out(file_descriptor_sink(fp));

   out << "Hello";

I don't recall if theres a file_descriptor that allows io.

Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk