Properties
Explore the concept of properties in the D programming language, learning how they let you use member functions as if they were variables. Understand how this feature enhances code clarity and functionality, including how slice lengths can be dynamically changed through property assignments without using parentheses.
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:
Looking merely at that usage, one might think that .length is ...