   template, iterators, and function problems
  My goal is to store collision call-back functions into the game (represented as a class). The game then will give the functions to any levels in the game. (The levels are manager classes). Here's some general code.Main:int main(int argc, char* argv[]){ Game game(640, 480, true); //640 x 480 fullscreen game.setGameFactory(new Factory()); //creates objects based on loaded file //What I want to do: set the collision functions -once- and never worry //about it again. game.addCollisionHandler(&collisionPlayerEnemy); game.addCollisionHandler(&collisionPlayerHealth); game.createNewLevel("IntroScreen"); //Obvious. Create some new levels. game.createNewLevel("Level1"); game.createNewLevel("Level2"); game.createNewLevel("GameOver"); //The level will stay the same when you come back to it game.getGameLevelManager("Level2").setPersistent(true);  //Load the level game.getGameLevelManager("IntroScreen").loadLevelFromFile("levels/introscreen.txt"); game.getGameLevelManager("Level1").loadLevelFromFile("levels/level1.txt"); game.getGameLevelManager("Level2").loadLevelFromFile("levels/level2.txt"); game.getGameLevelManager("GameOver").loadLevelFromFile("levels/gameover.txt"); /*Originally, the collision handling functions would be set    manually, but this is redundant and annoying. So it is supposed   to be dealt with elsewhere. game.getGameLevelManager("Level1").addCollisionHandler(&collisionPlayerEnemy); game.getGameLevelManager("Level1").addCollisionHandler(&collisionPlayerHealth); game.getGameLevelManager("Level2").addCollisionHandler(&collisionPlayerEnemy); game.getGameLevelManager("Level2").addCollisionHandler(&collisionPlayerHealth); */game.go();}The collision handlers:void collisionPlayerEnemy(Player* p, Enemy* e){ p->hurt(e->damage());}void collisionPlayerHealth(Player* p, Health* h){ p->heal(h->amount()); h->removeSelf(); //remove from game completely}The game.h code where the functions get passedtemplate <typename T, typename Y> void addCollisionHandler(void(*handlingFunction)(T*, Y*)){ boost::shared_ptr<GameLevelManager::AbstractCollisionManager> manager; manager.reset(new GameLevelManager::CollisionManager<T,Y>(handlingFunction)); vCollisionHandlers.push_back(manager);}The game.cpp part when a new level is created, the functions should be passed down immediately, or my goal is. this is the problem:void Game::createNewLevel(const std::string level){ window.createNewLevel(level);  for(std::vector<boost::shared_ptr<GameLevelManager::AbstractCollisionManager> >::iterator i = vCollisionHandlers.begin(); i != vCollisionHandlers.end(); i++) {  //getGameLevelManager(level).addCollisionHandler<?,?>(i);  //^How am I supposed to pass the T and Y typenames down??  //i::T? I dunno. O_o }}Help would be GREATLY appreciated.   
  Why would you need to pass the types down? Why don't you just give it the pointers you've got? Aren't you just going to "erase" the types again?   ;  Um. Didn't think about that. I'll try it out and reply if it works or not. Heh... thanks. :D   ;  Thanks, man. I can't believe I didn't that of that but credit goes to you. :DFor those of you who want to know how exactly I did it:GameLevelManager::setCollisionHandlers(std::vector<boost::shared_ptr<AbstractCollisionHanlder> > collisionHandlers){    vCollisionHandlers.clear();    vCollisionHanlders = collisionHandlers;}Then in the game.cppvoid Game::createNewLevel(const std::string level){ window.createNewLevel(level); getGameLevelManager(level).setCollisionHandlers(vCollisionHandlers);}Thanks again!