C++ using STL and function pointers