fork(3) download
  1. #include <iostream>
  2. using namespace std;
  3. template <class numtype>
  4. class Compare
  5. {
  6. public:
  7. numtype* x;
  8. };
  9.  
  10. class test
  11. {
  12. public:
  13. void fun(){
  14. std::cout << "fun" << std::endl;
  15. }
  16. };
  17.  
  18. int main()
  19. {
  20. Compare<test> a;
  21. a.x = new test();
  22. a.x->fun(); // <-- this line
  23. delete a.x;
  24. return 0;
  25. }
Success #stdin #stdout 0s 15224KB
stdin
Standard input is empty
stdout
fun