Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top