Skip to Content
C++ High Performance - Second Edition
book

C++ High Performance - Second Edition

by Björn Andrist, Viktor Sehr
December 2020
Intermediate to advanced
544 pages
12h 45m
English
Packt Publishing
Content preview from C++ High Performance - Second Edition

10

Proxy Objects and Lazy Evaluation

In this chapter, you will learn how to use proxy objects and lazy evaluation in order to postpone the execution of certain code until required. Using proxy objects enables optimizations to occur under the hood, thereby leaving the exposed interfaces intact.

This chapter covers:

  • Lazy and eager evaluation
  • Using proxy objects to avoid superfluous computations
  • Overloading operators when working with proxy objects

Introducing lazy evaluation and proxy objects

First and foremost, the techniques used in this chapter are used to hide optimizations in a library from the user of that library. This is useful because exposing every single optimization technique as a separate function requires a lot of attention and ...

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

C++ High Performance

C++ High Performance

Viktor Sehr, Björn Andrist

Publisher Resources

ISBN: 9781839216541Supplemental Content