All pastes #1450084 Raw Edit

Anonymous

public cpp v1 · immutable
#1450084 ·published 2009-06-06 20:55 UTC
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;}