fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename T> class tt
  5. {
  6. public :
  7. int data;
  8. tt()
  9. {
  10. std::cout << std::endl << " CONSTRUCTOR" << std::endl;
  11. }
  12. tt(const tt & that)
  13. {
  14. std::cout << std::endl << " COPY CONSTRUCTOR" << std::endl;
  15. }
  16. };
  17.  
  18.  
  19. tt<int> test(void)
  20. {
  21. std::cout << std::endl << " INSIDE " << std::endl; tt<int> a; a.data =10 ;return a;
  22. }
  23.  
  24. int main() {
  25. // your code goes her
  26. //tt<int> b;
  27. tt<int> a =test();
  28. cout<<a.data;
  29. return 0;
  30. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
      INSIDE 

   CONSTRUCTOR
10