COIN-OR::LEMON - Graph Library

Changeset 351:01fb9da7a363 in lemon-0.x


Ignore:
Timestamp:
04/17/04 21:54:04 (20 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@470
Message:

NullMap?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/alpar/rw_nonref_map.cc

    r342 r351  
    4444};
    4545
     46template<class K,class T>
     47class NullMap
     48{
     49public:
     50  typedef K KeyType;
     51  typedef T ValueType;
     52 
     53  class RefType
     54  {
     55    ValueType val;
     56  public:
     57    RefType(ValueType v) : val(v) { }   
     58    operator ValueType() const { return val; }
     59    ValueType operator = (ValueType v) const { return val; }
     60  };
     61 
     62private:
     63  ValueType val;
     64public:
     65  NullMap(ValueType v) : val(v) { }
     66  RefType operator[] (KeyType e) const { return RefType(v);} 
     67};
     68
    4669int main()
    4770{
Note: See TracChangeset for help on using the changeset viewer.