method

Used as an attribute: add an override to a method.

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

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

Constructors

this
this(string name)
Undocumented in source.

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