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 5. Resource Management

In this chapter, we will look at the resource management techniques of D. We'll learn the following:

  • Avoiding the garbage collector

  • Making a reference-counted object

  • Manually managing class memory

  • Using scope guards to manage transactions

  • Creating an array replacement

  • Managing lent resources

  • Creating a NotNull struct

  • Using unique pointers

  • Using RAII and handling the limitations of class destructors