O'Reilly logo

The D Programming Language by Andrei Alexandrescu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Operator Overloading

We programmers tend to dislike excessive separation between built-in types and user-defined types. Endowing built-in types with magic properties works against the openness and extensibility of any language because user-defined types are forever condemned to second-class status. Yet language designers have legitimate reasons to give built-in types the red carpet treatment. One such reason is that a language that’s too configurable becomes difficult to teach and also difficult to parse both by the human and by the machine. Each language tries to strike a good balance between the built-in and the configurable, some making it a point to get close to one of the two extremes.

D’s take on the matter is pragmatic: it ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required