Properties
Get a brief introduction to properties.
We'll cover the following...
We'll cover the following...
Introduction
Properties allow using member functions like member variables.
You are familiar with this feature from slices. The length property of a slice returns the number of elements of that slice:
Press + to interact
D
import std.stdio;void main() {int[] slice = [ 7, 8, 9 ];writeln(slice.length == 3);}
Looking merely at that usage, one might think that .length
is ...