Simple2012

Untitled

Feb 1st, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. #include <iostream>
  2. #include "p_queue.h"
  3. #include "aktie.h"
  4. #include "buying.h"
  5. #include "selling.h"
  6. #include <vector>
  7. #include <utility>
  8.  
  9. template <typename T>
  10. bool comp(T a, T b);
  11.  
  12. int main(){
  13.     std::pair<std::vector<buying>, std::vector<selling>> traders;
  14.     p_queue<buying> p_obj(comp);
  15.     p_queue<buying> p_objI(comp);
  16.    
  17.     traders.first.push_back(buying("nalle puh", 42));
  18.     traders.first.push_back(buying("clark kent", 300));
  19.     traders.first.push_back(buying("svampbob fyrkant", 78));
  20.  
  21.     traders.second.push_back(selling("Bruce Wayne", 42));
  22.  
  23.     p_objI.push(traders.second[0]);
  24.  
  25.  
  26.  
  27.     p_obj.push(traders.first[0]);
  28.     p_obj.push(traders.first[1]);
  29.     p_obj.push(traders.first[2]);
  30.  
  31.  
  32.     /*
  33.     p_queue<aktie> p_obj(comp);
  34.     p_obj.push(aktie("nasse", 2));
  35.  
  36.     p_obj.test();
  37.     p_obj.push(aktie("chocklade", 7777));
  38.     p_obj.pop();
  39.     p_obj.push(aktie("nomnom", 42));
  40.     */
  41.  
  42.     p_obj.test();
  43.     std::cout << "hellu";
  44.     std::cin.get();
  45. }
  46.  
  47. template <typename T>
  48. bool comp(T a, T b){
  49.     return a.price < b.price;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment