
Steven Watanabe wrote:
AMDG
On 2/11/2011 6:01 AM, Jeff Flinn wrote:
So having stdin, stdout, stderr Initializers with constructors or factory functions:
stdin_from() stdin_from(const path&) stdin_from(const file_descriptor_source&) stdin_from(const file_descriptor_ray&)
stdout_to() stdout_to(const path&) stdout_to(const file_descriptor_sink&) stdout_to(const file_descriptor_ray&)
stdout_to() stderr_to(const path&) stderr_to(const file_descriptor_sink&) stderr_to(const file_descriptor_ray&)
is to me conceptually much simpler than dealing with stream behaviour, stream end and context classes. It also minimizes copying and heap allocated handles.
I have to say that I prefer the use of stream_id to having separate functions for each stream.
Is there a way to do that and keep the compile time check that err/out are being connected to a sink, and in is being connected to a source? What is motivation for your preference? Thanks, Jeff