# HG changeset patch # User klao # Date 1082156409 0 # Node ID d8c452d54d37731f7ca8c6ff99ab043c1e06254c # Parent 9b24714c3b1c67f73e4bcdc5fa38c058ebeac4db Misterious bug with StdMap::set (?) Fixed default contstructor. diff -r 9b24714c3b1c -r d8c452d54d37 src/include/maps.h --- a/src/include/maps.h Fri Apr 16 22:00:11 2004 +0000 +++ b/src/include/maps.h Fri Apr 16 23:00:09 2004 +0000 @@ -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.