COIN-OR::LEMON - Graph Library

Changeset 890:3a48bc350e0f in lemon-0.x


Ignore:
Timestamp:
09/20/04 19:53:33 (20 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1198
Message:

Specialized ConstMap? for defining constant maps at compile time, by klao.
Time comparision of the generic and specialized maps.

Location:
src
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/maps.h

    r805 r890  
    7777  };
    7878
    79 
     79  //to document later
     80  template<typename T, T v>
     81  struct Const { };
     82  //to document later
     83  template<typename K, typename V, V v>
     84  class ConstMap<K, Const<V, v> > : public MapBase<K, V>
     85  {
     86  public:
     87    ConstMap() { }
     88    V operator[](const K&) const { return v; }
     89    void set(const K&, const V&) { }
     90  };
     91  //to document later
     92  typedef Const<bool, true> True;
     93  typedef Const<bool, false> False;
    8094
    8195  /// \c std::map wrapper
Note: See TracChangeset for help on using the changeset viewer.