fork download
  1. #include <iostream>
  2.  
  3. template<class T> class Node
  4. {
  5. public:
  6. T *pointer;
  7.  
  8. T& operator*()
  9. {
  10. return *pointer;
  11. }
  12. };
  13.  
  14.  
  15. int main(int argc, char const *argv[])
  16. {
  17. Node<int>* node = new Node<int>;
  18.  
  19. node->pointer = new int{2};
  20. std::cout << **node << std::endl;
  21. return 0;
  22. }
  23.  
  24.  
  25.  
Success #stdin #stdout 0s 3428KB
stdin
Standard input is empty
stdout
2