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


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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.