fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template<typename K, typename V> class SortedList;
  5. template<typename K, typename V> std::ostream& operator<< (std::ostream& o, const SortedList<K,V>& x);
  6.  
  7. template <typename K, typename V>
  8. struct Node
  9. {
  10. K key;
  11. V value;
  12. Node<K, V>* next;
  13. };
  14. template <typename K, typename V>
  15. class SortedList
  16. {
  17. friend ostream& operator << <>(ostream&, const SortedList&);
  18. public:
  19.  
  20. SortedList(){}
  21. SortedList(const SortedList&){}
  22. SortedList& operator = (const SortedList&){}
  23. ~SortedList(){}
  24.  
  25. void addItem(const K&, const V&){}
  26. void removeElem(const K&){}
  27. void removeAt(int){}
  28. bool remove(const K&){}
  29.  
  30.  
  31. private:
  32.  
  33. Node<K, V>* start;
  34. size_t n;
  35.  
  36. };
  37. std::ostream& operator<< (std::ostream& o, const SortedList<int,int>& x)
  38. {
  39. o << "Aloha" << endl;
  40. return o;
  41. }
  42.  
  43. int main() {
  44. SortedList<int, int> lst, lst2;
  45. int a = 2;
  46. lst.addItem(2, 3);
  47. cout << lst << endl;
  48. return 0;
  49. return 0;
  50. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Aloha