[Lemon-commits] [lemon_svn] klao: r464 - hugo/trunk/src/include

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


Author: klao
Date: Sat Apr 17 01:00:09 2004
New Revision: 464

Modified:
   hugo/trunk/src/include/maps.h

Log:
Misterious bug with StdMap::set (?)
Fixed default contstructor.


Modified: hugo/trunk/src/include/maps.h
==============================================================================
--- hugo/trunk/src/include/maps.h	(original)
+++ hugo/trunk/src/include/maps.h	Sat Apr 17 01:00:09 2004
@@ -77,7 +77,7 @@
     typedef const T& ConstReferenceType;
 
 
-    StdMap() {}
+    StdMap() : v() {}
     /// Constructor with specified default value
     StdMap(const T& _v) : v(_v) {}
 
@@ -103,7 +103,11 @@
 	return v;
       return (*i).second;
     }
-    void set(const Key &k, const T &t) { parent::operator[](k)=t; }
+    void set(const Key &k, const T &t) {
+      // tyuha, ez valamiert segfault-olt igy:
+      // parent::operator[](k) = t;
+      (  *( (insert(PairType(k,t))).first )  ).second=t;
+    }
 
     /// Changes the default value of the map.
     /// \return Returns the previous default value.



More information about the Lemon-commits mailing list