If I want to expose an iterator to a class member container, I can do so like this:
class PatchCollection
{
public:
// Iterator interface
typedef std::set<Patch>::iterator iterator;
typedef std::set<Patch>::const_iterator const_iterator;
iterator begin() { return SourcePatches.begin(); }
iterator end() { return SourcePatches.end(); }
private:
std::set<Patch> Patches;
};
However, if the member has to be a std::set<Patch*>, but I want the class's iterator to act like it is iterating over a set::<Patch> instead, what would I have to do?
Thanks,
David