|
Boost : |
From: Bryan Ross (me_at_[hidden])
Date: 2005-01-13 11:48:58
The problem I personally have run into in situations like that
(embedding references to std::cout and std::cin within my functions) is
that I often find myself needing to input from our output to a ifstream
or ofstream. Designing the functions from the ground up to use
references to i/ostreams alleviates the headache of heavily modifying
the program at a later date.
Bryan Ross
me_at_[hidden]
christopher diggins wrote:
> ----- Original Message ----- From: "Peter Dimov" <pdimov_at_[hidden]>
>
>>
>> IMO, this is how a more realistic example would look like:
>
> [snip]
>
>> This is just a reflection of the general "globals are bad" principle.
>
>
> Most of the application code I have seen written, does so directly to
> cout rather than to a function parameter. I also don't see any
> advantage to passing istream and ostream as function parameters, when
> cin and cout can be easily redirected using rdbuf.
>
> Christopher Diggins
> Object Oriented Template Library (OOTL)
> http://www.ootl.org
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk