Andrei Alexandrescu wrote:
Steven Schveighoffer wrote:
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 ...);
}

What exactly is the problem with requiring the input to the sink to be a string (or actually const(char)[])? Requiring an overload for every basic type + Object would be quite cumbersome if you had to do it every time you want to send the output somewhere else. Also, it wouldn't work for structs and unions... (Unless you plan to implement a default OutRange that converts everything it gets to strings and passes it on?)

Reply via email to