I\'m new to C/C++ programming, but I\'ve been programming in C# for 1.5 years now. I like C# and I like the List class, so I thought about making a List class in C++ as an e
As @yngum suggests, you can get the VC++ for each
extension to work with any arbitrary collection type by defining begin()
and end()
methods on the collection to return a custom iterator. Your iterator in turn has to implement the necessary interface (dereference operator, increment operator, etc). I've done this to wrap all of the MFC collection classes for legacy code. It's a bit of work, but can be done.