src/lemon/maps.h
changeset 987 87f7c54892df
parent 977 48962802d168
child 1041 9d503ce002db
     1.1 --- a/src/lemon/maps.h	Sat Nov 13 12:53:28 2004 +0000
     1.2 +++ b/src/lemon/maps.h	Sat Nov 13 17:07:10 2004 +0000
     1.3 @@ -36,9 +36,9 @@
     1.4    {
     1.5    public:
     1.6      ///\e
     1.7 -    typedef K KeyType;
     1.8 +    typedef K Key;
     1.9      ///\e
    1.10 -    typedef T ValueType;
    1.11 +    typedef T Value;
    1.12    };
    1.13  
    1.14    /// Null map. (a.k.a. DoNothingMap)
    1.15 @@ -108,20 +108,20 @@
    1.16    /// \c std::map wrapper
    1.17  
    1.18    /// This is essentially a wrapper for \c std::map. With addition that
    1.19 -  /// you can specify a default value different from \c ValueType() .
    1.20 +  /// you can specify a default value different from \c Value() .
    1.21    ///
    1.22    /// \todo Provide allocator parameter...
    1.23 -  template <typename Key, typename T, typename Compare = std::less<Key> >
    1.24 -  class StdMap : public std::map<Key,T,Compare> {
    1.25 -    typedef std::map<Key,T,Compare> parent;
    1.26 +  template <typename K, typename T, typename Compare = std::less<K> >
    1.27 +  class StdMap : public std::map<K,T,Compare> {
    1.28 +    typedef std::map<K,T,Compare> parent;
    1.29      T v;
    1.30      typedef typename parent::value_type PairType;
    1.31  
    1.32    public:
    1.33 -    typedef Key KeyType;
    1.34 -    typedef T ValueType;
    1.35 -    typedef T& ReferenceType;
    1.36 -    typedef const T& ConstReferenceType;
    1.37 +    typedef K Key;
    1.38 +    typedef T Value;
    1.39 +    typedef T& Reference;
    1.40 +    typedef const T& ConstReference;
    1.41  
    1.42  
    1.43      StdMap() : v() {}
    1.44 @@ -143,10 +143,10 @@
    1.45        //FIXME; 
    1.46      }
    1.47  
    1.48 -    ReferenceType operator[](const Key &k) {
    1.49 +    Reference operator[](const Key &k) {
    1.50        return insert(PairType(k,v)).first -> second;
    1.51      }
    1.52 -    ConstReferenceType operator[](const Key &k) const {
    1.53 +    ConstReference operator[](const Key &k) const {
    1.54        typename parent::iterator i = lower_bound(k);
    1.55        if (i == parent::end() || parent::key_comp()(k, (*i).first))
    1.56  	return v;