O'Reilly logo

Learn to Tango with D by Sean Kelly, Michael Parker, Kris Macleod Bell, Lars Ivar Igesund

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 5. Templates

Like many modern programming languages, D supports the use of generic programming to simplify coding. This is done using templates, and as you'll learn in this chapter, both type and function templates are supported. Additionally, this chapter covers template specialization, template metaprogramming, and compile-time function evaluation.

The Problem of Insufficient Information

In a statically typed language like D, object-oriented programming is a means of abstraction based on certain predefined characteristics. As you learned in Chapter 3, a set of characteristics common to a particular concept are specified in an interface, and a function written to operate on an interface is then able to manipulate any number of different ...

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