# HG changeset patch # User alpar # Date 1082231644 0 # Node ID 01fb9da7a3633fd75b9bf8bedb94488724e82fb5 # Parent 3a9a767b841e489d35515578a84e126479de7596 NullMap diff -r 3a9a767b841e -r 01fb9da7a363 src/work/alpar/rw_nonref_map.cc --- a/src/work/alpar/rw_nonref_map.cc Sat Apr 17 19:34:43 2004 +0000 +++ b/src/work/alpar/rw_nonref_map.cc Sat Apr 17 19:54:04 2004 +0000 @@ -43,6 +43,29 @@ RefType operator[] (Edge e) const { return RefType(G,e);} }; +template +class NullMap +{ +public: + typedef K KeyType; + typedef T ValueType; + + class RefType + { + ValueType val; + public: + RefType(ValueType v) : val(v) { } + operator ValueType() const { return val; } + ValueType operator = (ValueType v) const { return val; } + }; + +private: + ValueType val; +public: + NullMap(ValueType v) : val(v) { } + RefType operator[] (KeyType e) const { return RefType(v);} +}; + int main() { typedef SmartGraph Graph;