Lets say I have a linked list with a bunch of different data in it.
class Node
{
public:
Node* next;
AAA dataA;
BBB dataB;
CCC dataC;
};
Is there a way I make one iterator that would iterate over whatever variable I specify (rather than making three separate ones for each variable). I understand that the iterator could use templates to make it iterate over types AAA, BBB or CCC, but I don't know how I could specify which variable to return.