# HG changeset patch # User deba # Date 1129287640 0 # Node ID 22752dd6c69324fcbe937eba8d9278ceac1081ee # Parent b20777184ba8dc946ff680eb28a022877e4bc84b Using proper return type diff -r b20777184ba8 -r 22752dd6c693 lemon/graph_adaptor.h --- a/lemon/graph_adaptor.h Fri Oct 14 10:58:54 2005 +0000 +++ b/lemon/graph_adaptor.h Fri Oct 14 11:00:40 2005 +0000 @@ -1526,13 +1526,14 @@ else {exit.set(key, val); } } - typename ReferenceMapTraits::Reference + typename MapTraits::ReturnValue operator[](const Node& key) { if (key.entry) { return entry[key]; } else { return exit[key]; } } - T operator[](const Node& key) const { + typename MapTraits::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::Reference + typename MapTraits::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::ConstReturnValue + operator[](const Edge& key) const { if ((typename Parent::Edge&)key != INVALID) { return orig[key]; } else {return bind[key.bind]; } } diff -r b20777184ba8 -r 22752dd6c693 lemon/maps.h --- a/lemon/maps.h Fri Oct 14 10:58:54 2005 +0000 +++ b/lemon/maps.h Fri Oct 14 11:00:40 2005 +0000 @@ -18,7 +18,7 @@ #define LEMON_MAPS_H #include - +#include ///\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::ConstReturnValue + operator[](Key k) const {return m1[m2[k]];} }; ///Returns a \ref ComposeMap class