4. Separation of Concerns - Software Architecture, Functions, and Variadic Templates

Learning Objectives

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

  • Develop classes using the PIMPL idiom to implement object-level encapsulation
  • Implement a callback system using functors, std::function, and lambda expressions
  • Implement lambdas using the right capture technique for the situation
  • Develop variadic templates to implement C# style delegates for event handling.

This chapter will show you how to implement the PIMPL idiom, and how to develop a callback mechanism for your own programs.

Introduction

In the previous chapter, we learned how to implement classes to properly manage resources even when the exceptions occurred using RAII. We also ...

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.