Andrei Alexandrescu wrote:
Yah, glad someone mentioned it :o). The best way is a blend - you can statically dispatch on some popular/heavily-used names, then rely on a hashtable lookup for dynamic stuff.

Andrei


You suggest:

auto opDotExp(string name)(...)
{
        static if (name == "something")
        {
                code...
        }
        else
        {
                dynamic stuff
        }
}

That isn't very clear. Why not write it this way:

auto opDotExp(string name, ...)
{
        dynamic stuff
}

auto something (...)
{
        code...
}

Reply via email to