Laeeth Isharc:

In D there is a feature that allows a function to accept both an array of items and items,

yes - it is funny there is not an overloading that accepts arrays

I meant this D feature:


void foo(T)(T[] items...) {
    import std.stdio;
    items.writeln;
}
void main() {
    foo("red", "green", "blue");
    foo(["red", "green", "blue"]);
    auto a = ["red", "green", "blue"];
    foo(a);
}


Bye,
bearophile

Reply via email to