Guest User

Untitled

a guest
Aug 14th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. C Template Wrapper class for std::vector
  2. SceneVector.h: In member function ‘void scenegraph::SceneVector<V>::print()’:
  3. SceneVector.h:40: error: expected ‘;’ before ‘it’
  4. SceneVector.h:40: error: ‘it’ was not declared in this scope
  5.  
  6. #include <map>
  7. #include <vector>
  8. #include <iostream>
  9.  
  10. namespace scenegraph
  11. {
  12. template <class V> class SceneVector
  13. {
  14. typedef std::vector<V> Vector;
  15. Vector vector;
  16.  
  17. public:
  18. SceneVector();
  19. void insert(const V value);
  20. void print();
  21. };
  22.  
  23. template <class V> SceneVector<V>::SceneVector()
  24. {
  25. vector.clear();
  26. }
  27.  
  28. template <class V> void SceneVector<V>::insert(const V value)
  29. {
  30. vector.push_back(value);
  31. }
  32.  
  33. template <class V> void SceneVector<V>::print()
  34. {
  35. for(Vector::iterator it = vector.begin(); it != vector.end(); ++it)
  36. {
  37. std::cout << "[" << (*it) << "] " << std::endl;
  38. }
  39. std::cout << std::endl;
  40. }
  41. }
  42.  
  43. for(typename Vector::iterator it = vector.begin(); it != vector.end(); ++it)
  44.  
  45. std::vector<V>::iterator
Add Comment
Please, Sign In to add comment