Bug fix.
1.1 --- a/src/lemon/map_utils.h Fri Mar 11 16:29:03 2005 +0000
1.2 +++ b/src/lemon/map_utils.h Fri Mar 11 16:31:08 2005 +0000
1.3 @@ -14,6 +14,7 @@
1.4 *
1.5 */
1.6
1.7 +
1.8 ///\ingroup mutils
1.9 ///\file
1.10 ///\brief Map utilities.
1.11 @@ -191,7 +192,8 @@
1.12 virtual void build() {
1.13 Map::build();
1.14 Item it;
1.15 - for (getGraph()->first(it); it != INVALID; getGraph()->next(it)) {
1.16 + const Graph* graph = Map::getGraph();
1.17 + for (graph->first(it); it != INVALID; graph->next(it)) {
1.18 Map::set(it, invMap.size());
1.19 invMap.push_back(it);
1.20 }
1.21 @@ -242,7 +244,7 @@
1.22 /// \see inverse()
1.23 class InverseMap {
1.24 protected:
1.25 - InverseMap(const Graph& _graph) : graph(_graph) {}
1.26 + InverseMap(const Graph& _graph) : graph(&_graph) {}
1.27 public:
1.28 /// \brief Gives back the given item by its id.
1.29 ///
1.30 @@ -250,7 +252,7 @@
1.31 ///
1.32 Item operator[](int id) const { return graph->fromId(id, Item());}
1.33 private:
1.34 - Graph* graph;
1.35 + const Graph* graph;
1.36 };
1.37
1.38 /// \brief Constructor.
1.39 @@ -273,7 +275,6 @@
1.40
1.41 };
1.42
1.43 -
1.44 }
1.45
1.46 #endif