method

Attribute: Add an override to a method.

If called without an argument, the function name must consist of a method name, prefixed with an underscore. The function is added to the method as a specialization.

If called with a string argument, the string indicates the name of the method to specialize. The function name can then be any valid identifier. This is useful to allow an override to call a specific override without going through the dynamic dispatch mechanism.

struct method {}

Members

Variables

id
string id;
Undocumented in source.

Examples

@method
string _fight(Character x, Creature y, Axe z)
{
  ...
}

@method("times")
Matrix doubleTimesDiagonal(double a, immutable(DiagonalMatrix) b)
{
  ...
}

Meta