Skip to Content
Advanced C++
book

Advanced C++

by Gazihan Alankus, Olena Lizina, Rakesh Mane, Vivek Nagarajan, Brian Price
October 2019
Intermediate to advanced
762 pages
14h 7m
English
Packt Publishing
Content preview from Advanced C++

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

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Advanced C and C++ Compiling

Advanced C and C++ Compiling

Milan Stevanovic
Mastering C++ Programming

Mastering C++ Programming

Jeganathan Swaminathan
Expert C++

Expert C++

Vardan Grigoryan, Shunguang Wu
C++ High Performance

C++ High Performance

Viktor Sehr, Björn Andrist

Publisher Resources

ISBN: 9781838821135Supplemental Content