Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "p_queue.h"
- #include "aktie.h"
- #include "buying.h"
- #include "selling.h"
- #include <vector>
- #include <utility>
- template <typename T>
- bool comp(T a, T b);
- int main(){
- std::pair<std::vector<buying>, std::vector<selling>> traders;
- p_queue<buying> p_obj(comp);
- p_queue<buying> p_objI(comp);
- traders.first.push_back(buying("nalle puh", 42));
- traders.first.push_back(buying("clark kent", 300));
- traders.first.push_back(buying("svampbob fyrkant", 78));
- traders.second.push_back(selling("Bruce Wayne", 42));
- p_objI.push(traders.second[0]);
- p_obj.push(traders.first[0]);
- p_obj.push(traders.first[1]);
- p_obj.push(traders.first[2]);
- /*
- p_queue<aktie> p_obj(comp);
- p_obj.push(aktie("nasse", 2));
- p_obj.test();
- p_obj.push(aktie("chocklade", 7777));
- p_obj.pop();
- p_obj.push(aktie("nomnom", 42));
- */
- p_obj.test();
- std::cout << "hellu";
- std::cin.get();
- }
- template <typename T>
- bool comp(T a, T b){
- return a.price < b.price;
- }
Advertisement
Add Comment
Please, Sign In to add comment