[Lemon-commits] [lemon_svn] alpar: r470 - hugo/trunk/src/work/alpar

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:39:37 CET 2006


Author: alpar
Date: Sat Apr 17 21:54:04 2004
New Revision: 470

Modified:
   hugo/trunk/src/work/alpar/rw_nonref_map.cc

Log:
NullMap


Modified: hugo/trunk/src/work/alpar/rw_nonref_map.cc
==============================================================================
--- hugo/trunk/src/work/alpar/rw_nonref_map.cc	(original)
+++ hugo/trunk/src/work/alpar/rw_nonref_map.cc	Sat Apr 17 21:54:04 2004
@@ -43,6 +43,29 @@
   RefType operator[] (Edge e) const { return RefType(G,e);}  
 };
 
+template<class K,class T>
+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;



More information about the Lemon-commits mailing list