Property

Generates a getter and setter for a field.

template Property (
alias field
AccessModifier setterAccess = AccessModifier.Protected
AccessModifier getterAccess = AccessModifier.Public
string name = field.stringof[1 .. $]
) {
enum Property;
}

Parameters

field

The field to generate the property for.

setterAccess

The access modifier for the setter function.

getterAccess

The access modifier for the getter funciton.

name

The name of the property functions. Defaults to the field name minus the first character. Meant for fields that start with underscores.

Meta