Hello,

Is there a way to the following thing in a class instead of a struct?

--------------------------------------
static struct Point
{
    int x, y;

void toString(W)(ref W writer, scope const ref FormatSpec!char f)
    if (isOutputRange!(W, char))
    {
        // std.range.primitives.put
        put(writer, "(");
        formatValue(writer, x, f);
        put(writer, ",");
        formatValue(writer, y, f);
        put(writer, ")");
    }
}
--------------------------------------

I think the problem is that the toString() in a class is virtual, and don't let me to have multiple overloaded methods.

Is there a way to let format() deal with classes too?

Thank You!

Reply via email to