COIN-OR::LEMON - Graph Library

Changeset 987:87f7c54892df in lemon-0.x for src/lemon/maps.h


Ignore:
Timestamp:
11/13/04 18:07:10 (19 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1377
Message:

Naming changes:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/maps.h

    r977 r987  
    3737  public:
    3838    ///\e
    39     typedef K KeyType;
     39    typedef K Key;
    4040    ///\e
    41     typedef T ValueType;
     41    typedef T Value;
    4242  };
    4343
     
    109109
    110110  /// This is essentially a wrapper for \c std::map. With addition that
    111   /// you can specify a default value different from \c ValueType() .
     111  /// you can specify a default value different from \c Value() .
    112112  ///
    113113  /// \todo Provide allocator parameter...
    114   template <typename Key, typename T, typename Compare = std::less<Key> >
    115   class StdMap : public std::map<Key,T,Compare> {
    116     typedef std::map<Key,T,Compare> parent;
     114  template <typename K, typename T, typename Compare = std::less<K> >
     115  class StdMap : public std::map<K,T,Compare> {
     116    typedef std::map<K,T,Compare> parent;
    117117    T v;
    118118    typedef typename parent::value_type PairType;
    119119
    120120  public:
    121     typedef Key KeyType;
    122     typedef T ValueType;
    123     typedef T& ReferenceType;
    124     typedef const T& ConstReferenceType;
     121    typedef K Key;
     122    typedef T Value;
     123    typedef T& Reference;
     124    typedef const T& ConstReference;
    125125
    126126
     
    144144    }
    145145
    146     ReferenceType operator[](const Key &k) {
     146    Reference operator[](const Key &k) {
    147147      return insert(PairType(k,v)).first -> second;
    148148    }
    149     ConstReferenceType operator[](const Key &k) const {
     149    ConstReference operator[](const Key &k) const {
    150150      typename parent::iterator i = lower_bound(k);
    151151      if (i == parent::end() || parent::key_comp()(k, (*i).first))
Note: See TracChangeset for help on using the changeset viewer.