[Lemon-commits] [lemon_svn] deba: r2252 - hugo/trunk/lemon
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:51:16 CET 2006
Author: deba
Date: Fri Oct 14 13:00:40 2005
New Revision: 2252
Modified:
hugo/trunk/lemon/graph_adaptor.h
hugo/trunk/lemon/maps.h
Log:
Using proper return type
Modified: hugo/trunk/lemon/graph_adaptor.h
==============================================================================
--- hugo/trunk/lemon/graph_adaptor.h (original)
+++ hugo/trunk/lemon/graph_adaptor.h Fri Oct 14 13:00:40 2005
@@ -1526,13 +1526,14 @@
else {exit.set(key, val); }
}
- typename ReferenceMapTraits<NodeImpl>::Reference
+ typename MapTraits<NodeImpl>::ReturnValue
operator[](const Node& key) {
if (key.entry) { return entry[key]; }
else { return exit[key]; }
}
- T operator[](const Node& key) const {
+ typename MapTraits<NodeImpl>::ConstReturnValue
+ operator[](const Node& key) const {
if (key.entry) { return entry[key]; }
else { return exit[key]; }
}
@@ -1556,13 +1557,14 @@
else {bind.set(key.bind, val); }
}
- typename ReferenceMapTraits<EdgeImpl>::Reference
+ typename MapTraits<EdgeImpl>::ReturnValue
operator[](const Edge& key) {
if ((typename Parent::Edge&)key != INVALID) { return orig[key]; }
else {return bind[key.bind]; }
}
- T operator[](const Edge& key) const {
+ typename MapTraits<EdgeImpl>::ConstReturnValue
+ operator[](const Edge& key) const {
if ((typename Parent::Edge&)key != INVALID) { return orig[key]; }
else {return bind[key.bind]; }
}
Modified: hugo/trunk/lemon/maps.h
==============================================================================
--- hugo/trunk/lemon/maps.h (original)
+++ hugo/trunk/lemon/maps.h Fri Oct 14 13:00:40 2005
@@ -18,7 +18,7 @@
#define LEMON_MAPS_H
#include <lemon/utility.h>
-
+#include <lemon/traits.h>
///\file
///\ingroup maps
@@ -521,7 +521,9 @@
///Constructor
ComposeMap(const M1 &_m1,const M2 &_m2) : m1(_m1), m2(_m2) {};
- Value operator[](Key k) const {return m1[m2[k]];}
+
+ typename MapTraits<M1>::ConstReturnValue
+ operator[](Key k) const {return m1[m2[k]];}
};
///Returns a \ref ComposeMap class
More information about the Lemon-commits
mailing list