views:

98

answers:

1

I've got a COM object that returns an IEnumUnknown. Is there anything out there that'll turn it into an STL-style iterator? So that I can do something like this:

IEnumUnkPtr pEnumUnk;
// ...something that fills in pEnumUnk...
MagicThing m(pEnumUnk);
std::for_each(m.begin(), m.end(), DoSomethingWithUnk);

...or similar?

+2  A: 

Seems like the comstl project has what you need: http://www.stlsoft.org/doc-1.9/classcomstl_1_1enumerator__sequence.html

Nick