rendered paste body#include <iostream>#include <fstream>#include <vector>#include <string>#include <map>#include <float.h>#include <list>#include <stdlib.h>#include <stack>#include <queue>class City { public: /** \brief adjacency list of this city */ std::vector<City*> Adj; /** \brief redecessor pointer */ City* p; /** \brief city value */ double d; /** \brief name of this city */ std::string name; /** \brief constructor with the city name as argument */ City(std::string name) { this->name=name; d=DBL_MAX; p=NULL; } /** \brief get (cost) value */ double getValue() const { return d; }};struct CompareMethod { bool operator()(const City* a, const City* b) const { // Be sure to implement this function as "strictly less than" std::cout << "Ketchup!" << std::endl; return a->getValue() < b->getValue(); }};void doStuff() { std::priority_queue<City*, std::queue<City*>, CompareMethod > Q;}laga@mbe:~/uni/alda/blatt10$ g++ dijkstra_route_template.cpp dijkstra_route_template.cpp: In function ‘void dijkstra(std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, City*, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, City*> > >&, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, double, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, double> > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, double, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, double> > > > > >&, std::string)’:dijkstra_route_template.cpp:180: error: invalid initialization of reference of type ‘std::priority_queue<City*, std::vector<City*, std::allocator<City*> >, std::less<City*> >&’ from expression of type ‘std::priority_queue<City*, std::queue<City*, std::deque<City*, std::allocator<City*> > >, CompareMethod>’dijkstra_route_template.cpp:133: error: in passing argument 1 of ‘City* getMinimum(std::priority_queue<City*, std::vector<City*, std::allocator<City*> >, std::less<City*> >&)’/usr/include/c++/4.3/bits/stl_queue.h: In constructor ‘std::priority_queue<_Tp, _Sequence, _Compare>::priority_queue(const _Compare&, const _Sequence&) [with _Tp = City*, _Sequence = std::queue<City*, std::deque<City*, std::allocator<City*> > >, _Compare = CompareMethod]’:dijkstra_route_template.cpp:157: instantiated from here/usr/include/c++/4.3/bits/stl_queue.h:405: error: ‘class std::queue<City*, std::deque<City*, std::allocator<City*> > >’ has no member named ‘begin’/usr/include/c++/4.3/bits/stl_queue.h:405: error: ‘class std::queue<City*, std::deque<City*, std::allocator<City*> > >’ has no member named ‘end’/usr/include/c++/4.3/bits/stl_queue.h: In member function ‘void std::priority_queue<_Tp, _Sequence, _Compare>::push(const typename _Sequence::value_type&) [with _Tp = City*, _Sequence = std::queue<City*, std::deque<City*, std::allocator<City*> > >, _Compare = CompareMethod]’:dijkstra_route_template.cpp:170: instantiated from here/usr/include/c++/4.3/bits/stl_queue.h:516: error: ‘class std::queue<City*, std::deque<City*, std::allocator<City*> > >’ has no member named ‘push_back’/usr/include/c++/4.3/bits/stl_queue.h:517: error: ‘class std::queue<City*, std::deque<City*, std::allocator<City*> > >’ has no member named ‘begin’/usr/include/c++/4.3/bits/stl_queue.h:517: error: ‘class std::queue<City*, std::deque<City*, std::allocator<City*> > >’ has no member named ‘end’