On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu <[email protected]> wrote:

Steven Schveighoffer wrote:
This has to go into object.d and be part of the runtime, where std.range doesn't exist. There is nothing stopping you from calling:
 streamOut(&outputrange.put);
 So I'd rather have a sink function.

It must be a sink _object_ so it can hold its own state. And it must support put() so it integrates with statically-bound output ranges.

interface OutRange
{
     void put(... a number of overloads ...);
}

I see now, yes I agree (I think that was don's original request anyways). That interface has to go in the runtime, though.

We may not be able to do this using templates... it has to be a virtual function in Object to be on-par with toString. This means struct interfaces are a requirement if you want to use ranges :(

-Steve

Reply via email to