fork download
  1. template <class T> struct node {
  2. T value;
  3. node<T> * next;
  4. };
  5.  
  6. template<class T> class MagicBag {
  7. public:
  8. MagicBag() {
  9. first = 0;
  10. }
  11.  
  12. ~MagicBag() {
  13. }
  14.  
  15. void insert(T item) {
  16. //have code here
  17. }
  18. private:
  19. node<T> * first;
  20. int size = 0;
  21. };
  22.  
  23. int main() {
  24. MagicBag<int> mb1;//this is where I'm getting the error
  25. mb1.insert(5);
  26. mb1.insert(4);
  27. return 0;
  28. }
Success #stdin #stdout 0s 3408KB
stdin
Standard input is empty
stdout
Standard output is empty