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?
Seems like the comstl project has what you need: http://www.stlsoft.org/doc-1.9/classcomstl_1_1enumerator__sequence.html