Book Image

D Cookbook

By : Adam Ruppe
Book Image

D Cookbook

By: Adam Ruppe

Overview of this book

Table of Contents (21 chapters)
D Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 3. Ranges

In this chapter, we will investigate the concept of ranges, which is used throughout the D code. We'll look at the following recipes:

  • Using ranges when implementing an algorithm

  • Creating an input range

  • Creating an output range

  • Creating a higher-order range

  • Putting a range interface on a collection

  • Creating an input range over a tree structure

  • Using runtime polymorphic (class) ranges

  • Storing a range as a data member

  • Sorting ranges efficiently

  • Searching ranges

  • Using functional tools to query data