fork(1) download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. template<class T>
  5. class Game
  6. {
  7. public:
  8.  
  9. //Game-related
  10. T processEvents(std::string input);
  11.  
  12. void display(T action);
  13. };
  14.  
  15. template<class T>
  16. T Game<T>::processEvents(std::string input)
  17. {
  18. std::cout << "Game::processEvents(\"" << input << "\")\n";
  19. return T();
  20. //
  21. }
  22.  
  23. template<class T>
  24. void Game<T>::display(T action)
  25. {
  26. std::cout << "Game::Display(" << action << ")\n";
  27. }
  28.  
  29. int main()
  30. {
  31. Game<int> game;
  32.  
  33. game.processEvents("a string");
  34. game.display(69);
  35. }
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
Game::processEvents("a string")
Game::Display(69)