O'Reilly logo

Efficient C++ Performance Programming Techniques by David Mayhew, Dov Bulka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Preexisting Classes

Our previous implementation of a reference-counted BigInt class involved some modifications to the original BigInt implementation. That required, of course, that we had the liberty to modify the BigInt source code. This option is not always available. The target class could come from a library whose source code is not given. We can still implement reference counting for such preexisting, hands-off target classes, but we need to make some design changes.

Previously, with access to the source code, we added the reference counter to BigInt by making BigInt inherit from RCObject. Now that we cannot touch the BigInt implementation, we must introduce a separate class to hold the reference count and manipulate it. Meyers calls this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required