3. No Leaks Allowed - Exceptions and Resources

Learning Objectives

By the end of this chapter, you will be able to:

  • Develop classes to manage resources
  • Develop exception-robust code so that the resources do not leak through RAII
  • Implement classes that can transfer resource ownership through move semantics
  • Implement classes that control implicit conversion

In this chapter, you will learn how to use a class to manage resources, protect against leaks, and prevent copying a large amount of data.

Introduction

In Chapter 2A, No Ducks Allowed – Types, and Deduction, we briefly touched on some concepts, such as smart pointers and move semantics. In this chapter, we'll be exploring them further. It turns out that these topics are very closely ...

Get Advanced C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.