hi, I'm coding the queue of Primer book (template chapter). but I've a prob.
Qt Code:
  1. error C2440: '=' : cannot convert from 'QueueItem<Type> *' to 'int *'
  2. with
  3. [
  4. Type=int
  5. ]
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. template <class Type> class Queue;
  2.  
  3. template <class Type>
  4. class QueueItem {
  5. private:
  6. friend class Queue<Type>;
  7. public:
  8.  
  9. Type value;
  10. Type* next;
  11. QueueItem(const Type& t) : value(t) {next=0;}
  12. ~QueueItem();
  13. };
  14. template <class Type>
  15. class Queue {
  16. private:
  17. QueueItem<Type>* tail;
  18. QueueItem<Type>* head;
  19. public:
  20. Type& remove();
  21. void insert(const Type&);
  22. void print();
  23. bool empty() const {return (head == 0);}
  24. Queue();
  25. ~Queue();
  26. };
  27.  
  28. template <class Type>
  29. void Queue<Type>::insert(const Type& value) {
  30. QueueItem<Type>* p = new QueueItem<Type>(value);
  31. tail->next = p; //here problem
  32. tail = p;
  33. }
To copy to clipboard, switch view to plain text mode 
How to solve it? Type should be int when i'm go inside insert method.....
thanks