Boost logo

Boost :

Subject: Re: [boost] [process] Formal Review starts today, 27 October
From: Edward Diener (eldiener_at_[hidden])
Date: 2016-10-31 20:07:25


On 10/31/2016 6:02 PM, Gavin Lambert wrote:
> On 1/11/2016 03:27, Edward Diener wrote:
>> I found the notation for the std_out, std_err, and std_in to be exactly
>> the opposite of what I would expect. I would think std_out and std_err
>> would use a '<' notation and std_in would use a '>' notation. But using
>> the pipes was fairly straightforward. I found the naming in the tutorial
>> a bit strange, where a bp::opstream is called 'in' and a bp::ipstream is
>> called 'out'.
>
> bp::std_out > stdout
> bp::std_out > "output.txt"
> bp::std_in < "input.txt"
>
> These seem the right way around to me, and reminiscent of how they're
> used in a shell; just with the extra keyword in front. Pretend the
> keyword is the process name instead.

I was thinking in terms of:

std::ostream some_output_stream(...);

some_output_stream << some_value;

However I agree that your own example corresponds to streams in shells.
I do not think the syntax is a big issue, however.

>
> Having said that, due to the presence of the keyword, perhaps assignment
> would be a better syntax, similar to bp::args? eg:
>
> bp::std_out = stdout
> bp::std_out = "output.txt"
> bp::std_in = "input.txt"
>
> ?


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