
4 Sep
2002
4 Sep
'02
5:16 p.m.
Hello, My problem I think is very simple, I just can't seem to find the solution I have an STL list of object pointers and I want to call a member function on each of the pointers in the list usigng the STL for_each algorithm. This would seem easy if the list contained the actual objects rather than pointers to them, but because they are pointers I can't find a way of doing this. class Block { public: void update(int x); }; void main() { list<Block*> blocks; for_each(blocks.begin(), blocks.end(), *****); // Call update on each item in list } what should I replace the ***** with? Any help appreciated! Mark.