Chapter 28. Adapting COM Enumerators

 

A subtle thought that is in error may yet give rise to fruitful inquiry that can establish truths of great value.

 
 --Isaac Asimov
 

Smoke me a kipper, I’ll be back for breakfast!

 
 --Ace Rimmer, Red Dwarf

Introduction

One of the technical reasons that COM has fallen out of favor in this millennium is the extreme verbosity of code in C++. Two more are the complexity of reference-count management and the relative ease with which users can mismanage resource ownership, both of which can lead to leaks and/or double deletion. COM enumerators and COM collections are two of the major problem areas. This is compounded by the fact that, because they are language-independent, COM interface methods may not throw exceptions, ...

Get Extended STL, Volume 1: Collections and Iterators 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.