src/include/maps.h
changeset 390 8dc830d3f9ef
parent 346 538ff3ce9f68
child 391 ddf25b2fa6ab
equal deleted inserted replaced
2:b769989c6f9c 3:c29ae6e9865e
    90     ///
    90     ///
    91     /// \warning Inefficient: copies the content of \c m !
    91     /// \warning Inefficient: copies the content of \c m !
    92     StdMap(const parent &m, const T& _v) : parent(m), v(_v) {}
    92     StdMap(const parent &m, const T& _v) : parent(m), v(_v) {}
    93     
    93     
    94     template<typename T1, typename Comp1>
    94     template<typename T1, typename Comp1>
    95     StdMap(const StdMap<Key,T1,Comp1> &m, const T &_v) { FIXME; }
    95     StdMap(const StdMap<Key,T1,Comp1> &m, const T &_v) { 
       
    96       //FIXME; 
       
    97     }
    96 
    98 
    97     ReferenceType operator[](const Key &k) {
    99     ReferenceType operator[](const Key &k) {
    98       return insert(PairType(k,v)).first -> second;
   100       return insert(PairType(k,v)).first -> second;
    99     }
   101     }
   100     ConstReferenceType operator[](const Key &k) const {
   102     ConstReferenceType operator[](const Key &k) const {
   101       typename parent::iterator i = lower_bound(__k);
   103 //marci jav      typename parent::iterator i = lower_bound(__k);
       
   104       typename parent::iterator i = lower_bound(k);
   102       if (i == end() || key_comp()(k, (*i).first))
   105       if (i == end() || key_comp()(k, (*i).first))
   103 	return v;
   106 	return v;
   104       return (*i).second;
   107       return (*i).second;
   105     }
   108     }
   106     void set(const Key &k, const T &t) {
   109     void set(const Key &k, const T &t) {