Misterious bug with StdMap::set (?)
authorklao
Fri, 16 Apr 2004 23:00:09 +0000
changeset 345d8c452d54d37
parent 344 9b24714c3b1c
child 346 538ff3ce9f68
Misterious bug with StdMap::set (?)
Fixed default contstructor.
src/include/maps.h
     1.1 --- a/src/include/maps.h	Fri Apr 16 22:00:11 2004 +0000
     1.2 +++ b/src/include/maps.h	Fri Apr 16 23:00:09 2004 +0000
     1.3 @@ -77,7 +77,7 @@
     1.4      typedef const T& ConstReferenceType;
     1.5  
     1.6  
     1.7 -    StdMap() {}
     1.8 +    StdMap() : v() {}
     1.9      /// Constructor with specified default value
    1.10      StdMap(const T& _v) : v(_v) {}
    1.11  
    1.12 @@ -103,7 +103,11 @@
    1.13  	return v;
    1.14        return (*i).second;
    1.15      }
    1.16 -    void set(const Key &k, const T &t) { parent::operator[](k)=t; }
    1.17 +    void set(const Key &k, const T &t) {
    1.18 +      // tyuha, ez valamiert segfault-olt igy:
    1.19 +      // parent::operator[](k) = t;
    1.20 +      (  *( (insert(PairType(k,t))).first )  ).second=t;
    1.21 +    }
    1.22  
    1.23      /// Changes the default value of the map.
    1.24      /// \return Returns the previous default value.