Advertisement
eXFq7GJ1cC

Untitled

Apr 28th, 2012
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. #include <vector>
  2. #include <string>
  3. #include <map>
  4. #include <list>
  5. using namespace std;
  6.  
  7. void useint(int);
  8. void usestring(const string &);
  9.  
  10. void testvec(vector<int> v)
  11. {  
  12.     for(vector<int>::iterator it = v.begin(); it != v.end();
  13. #ifdef USE_POSTINCREMENT
  14.             it++) {
  15. #else
  16.             ++it) {
  17. #endif
  18.         useint(*it);
  19.     }
  20. }
  21.  
  22. void testmap(map<string,string> m)
  23. {  
  24.     for(map<string,string>::iterator it = m.begin(); it != m.end();
  25. #ifdef USE_POSTINCREMENT
  26.             it++) {
  27. #else
  28.             ++it) {
  29. #endif
  30.         usestring(it->second);
  31.     }
  32. }
  33.  
  34. void testlist(list<string> l)
  35. {  
  36.     for(list<string>::iterator it = l.begin(); it != l.end();
  37. #ifdef USE_POSTINCREMENT
  38.             it++) {
  39. #else
  40.             ++it) {
  41. #endif
  42.         usestring(*it);
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement